I want to use htl-maven-plugin to validate HTL syntax. I am using the plugin shown below:
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>htl-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<id>validate-scripts</id>
<goals>
<goal>validate</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<sourceDirectory>ui.apps/src/main/content/jcr_root</sourceDirectory>
<failOnWarnings>true</failOnWarnings>
<includes>**/*.html</includes>
</configuration>
</plugin>
But it's not validating my HTL part and make the build success. Please help!!!
Most probably your
sourceDirectory
is not properly configured. Are your sources really inui.apps/src/main/content/jcr_root
? If not, please update the configuration!If your project is structured as:
The
sourceDirectory
inui.apps/pom.xml
should be configured tosrc/main/content/jcr_root
(relative toui.apps
modulepom
)Also, running
mvn htl:validate
from the command line inui.apps
module will give you a bit more information about what is happening. You should see either:[INFO] Source directory does not exist, skipping.
- source directory is not configured properly.[INFO] Processed .. files in .. milliseconds
- source is configured, files were processedFor more documentation please also refer to http://sling.apache.org/components/htl-maven-plugin/plugin-info.html