Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

htl-maven-plugin dependency error

Avatar

Level 2

Execution transpile-scripts of goal org.apache.sling:htl-maven-plugin:1.3.4-1.4.0:validate failed: Plugin org.apache.sling:htl-maven-plugin:1.3.4-1.4.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.sling:htl-maven-plugin:jar:1.3.4-1.4.0 -> org.apache.sling:org.apache.sling.scripting.sightly.compiler.java:jar:1.1.4-1.4.0 (org.apache.sling:htl-maven-plugin:1.3.4-1.4.0:validate:transpile-scripts:generate-sources)



While running code repo in eclipse getting this .

Please help me with the solution

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Mounikasri ,

 

I am using mvn project with archetype version 35.

 

My main POM has :

<!-- HTL Maven Plugin -->
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>htl-maven-plugin</artifactId>
                    <version>1.3.4-1.4.0</version>
                    <configuration>
                        <failOnWarnings>true</failOnWarnings>
                    </configuration>
                </plugin>

And in my ui.apps/pom.xml, I added(what you have shared in comment):

<plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>htl-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>validate-htl-scripts</id>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <generateJavaClasses>true</generateJavaClasses>
                            <generatedJavaClassesPrefix>org.apache.sling.scripting.sightly</generatedJavaClassesPrefix>
                            <allowedExpressionOptions>
                                <allowedExpressionOption>cssClassName</allowedExpressionOption>
                                <allowedExpressionOption>decoration</allowedExpressionOption>
                                <allowedExpressionOption>decorationTagName</allowedExpressionOption>
                                <allowedExpressionOption>wcmmode</allowedExpressionOption>
                            </allowedExpressionOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

And I triggered:

mvn htl:validate

and it works totally fine with me.

 

Screenshot 2022-02-22 at 12.40.40 AM.png

 

Please refer the documentation:

https://sling.apache.org/components/htl-maven-plugin/usage.html

 

Regards,

Milind

View solution in original post

3 Replies

Avatar

Level 5

Could you please provide your pom.xml file and with which archetype you have created the project.

 

Also please verify this thread as well

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/unable-to-update-htl-maven...

Avatar

Level 2

Hi @Manikumar  
Created the project with archetype-3.2.1.jar

 and with both  transpile-scripts and alidate-htl-scripts same error getting 

 

under ui.apps/pom.xml

<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>htl-maven-plugin</artifactId>
<executions>
<execution>
<id>validate-htl-scripts</id>
<goals>
<goal>validate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<generateJavaClasses>true</generateJavaClasses>
<generatedJavaClassesPrefix>org.apache.sling.scripting.sightly</generatedJavaClassesPrefix>
<allowedExpressionOptions>
<allowedExpressionOption>cssClassName</allowedExpressionOption>
<allowedExpressionOption>decoration</allowedExpressionOption>
<allowedExpressionOption>decorationTagName</allowedExpressionOption>
<allowedExpressionOption>wcmmode</allowedExpressionOption>
</allowedExpressionOptions>
</configuration>
</execution>
</executions>
</plugin>

 

 

Avatar

Correct answer by
Employee Advisor

Hi @Mounikasri ,

 

I am using mvn project with archetype version 35.

 

My main POM has :

<!-- HTL Maven Plugin -->
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>htl-maven-plugin</artifactId>
                    <version>1.3.4-1.4.0</version>
                    <configuration>
                        <failOnWarnings>true</failOnWarnings>
                    </configuration>
                </plugin>

And in my ui.apps/pom.xml, I added(what you have shared in comment):

<plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>htl-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>validate-htl-scripts</id>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <generateJavaClasses>true</generateJavaClasses>
                            <generatedJavaClassesPrefix>org.apache.sling.scripting.sightly</generatedJavaClassesPrefix>
                            <allowedExpressionOptions>
                                <allowedExpressionOption>cssClassName</allowedExpressionOption>
                                <allowedExpressionOption>decoration</allowedExpressionOption>
                                <allowedExpressionOption>decorationTagName</allowedExpressionOption>
                                <allowedExpressionOption>wcmmode</allowedExpressionOption>
                            </allowedExpressionOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

And I triggered:

mvn htl:validate

and it works totally fine with me.

 

Screenshot 2022-02-22 at 12.40.40 AM.png

 

Please refer the documentation:

https://sling.apache.org/components/htl-maven-plugin/usage.html

 

Regards,

Milind