Expand my Community achievements bar.

SOLVED

AEM cloud build Issue about htl-maven-plugin

Avatar

Level 2

Hi there,
I am facing  a build failure after using   "mvn -PautoInstallSinglePackage clean install"
Here's my version details
Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: C:\Program Files\Maven\apache-maven-3.8.8
Java version: 11.0.23, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

[ERROR] Failed to execute goal org.apache.sling:htl-maven-plugin:2.0.2-1.4.0:validate (validate-htl-scripts) on project aem-jupiteram-project.ui.apps: Execution validate-htl-scripts of goal org.apache.sling:htl-maven-plugin:2.0.2-1.4.0:validate failed: A required class was missing while executing org.apache.sling:htl-maven-plugin:2.0.2-1.4.0:validate: org/apache/sling/scripting/sightly/java/compiler/JavaImportsAnalyzer
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.sling:htl-maven-plugin:2.0.2-1.4.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy


Could you please give me any suggestions about fixing this issue?
I uninstall and reinstalled everything, but it did not help me to fix this issue

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AKurtulush 
it seems that the htl-maven-plugin is missing a required class org/apache/sling/scripting/sightly/java/compiler/JavaImportsAnalyzer. This could be due to a compatibility issue or a corrupted installation.
1.Clean the Maven repository: Sometimes, corrupted dependencies in the local Maven repository can cause build failures. You can try deleting the contents of the .m2/repository directory in your user home directory and then re-run the build command.
2.Check for conflicting dependencies: It's possible that there are conflicting dependencies in your project's pom.xml file. You can use the Maven Dependency Plugin to analyze the dependency tree and identify any conflicts.
try this command mvn dependency:tree.
3.Java version you are using is compatible with the Maven and the plugin. In your case, Java 11 seems to be installed, which should be compatible. However, you can double-check if there are any specific Java version requirements for the htl-maven-plugin.



View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @AKurtulush 
it seems that the htl-maven-plugin is missing a required class org/apache/sling/scripting/sightly/java/compiler/JavaImportsAnalyzer. This could be due to a compatibility issue or a corrupted installation.
1.Clean the Maven repository: Sometimes, corrupted dependencies in the local Maven repository can cause build failures. You can try deleting the contents of the .m2/repository directory in your user home directory and then re-run the build command.
2.Check for conflicting dependencies: It's possible that there are conflicting dependencies in your project's pom.xml file. You can use the Maven Dependency Plugin to analyze the dependency tree and identify any conflicts.
try this command mvn dependency:tree.
3.Java version you are using is compatible with the Maven and the plugin. In your case, Java 11 seems to be installed, which should be compatible. However, you can double-check if there are any specific Java version requirements for the htl-maven-plugin.



Avatar

Level 2

Hi Raja,
Thanks for your suggestions.
Deleted my .m2/repository and rebuild project again. That worked for me

Avatar

Community Advisor

@AKurtulush 

 

It seems your HTL is importing a java class (may be a Sling Model) which is not available.

  • Please build the core bundle first
  • Assure that these imports are available. Best to check via the bundle information in /system/console/bundles/<your bundle>
  • Build the apps module which is causing issue.

It should be resolved now. You can even try after building the entire Project once, if apps is built after core & the import is available, the complete build should go through.


Aanchal Sikka