我想使用HTL插件来验证HTL语法。我使用的插件如下所示:
<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>但这并不是验证我的HTL部分并使构建成功。救命啊!
发布于 2017-05-22 07:26:09
很可能您的sourceDirectory没有正确配置。你的消息来源真的在ui.apps/src/main/content/jcr_root吗?如果没有,请更新配置!
如果您的项目结构为:
- ui.content
- ..
应该将ui.apps/pom.xml中的ui.apps/pom.xml配置为src/main/content/jcr_root (相对于ui.apps模块pom)
此外,从mvn htl:validate模块中的命令行运行ui.apps将为您提供有关正在发生的事情的更多信息。你应该看到:
[INFO] Source directory does not exist, skipping. -源目录配置不正确.[INFO] Processed .. files in .. milliseconds -源代码,处理了文件。有关更多文档,请参见http://sling.apache.org/components/htl-maven-plugin/plugin-info.html
https://stackoverflow.com/questions/44106744
复制相似问题