getting groovy error while creating new aem project using maven archtype | Community
Skip to main content
Level 2
June 8, 2025
Solved

getting groovy error while creating new aem project using maven archtype

  • June 8, 2025
  • 1 reply
  • 630 views

Hi All ,

 

I am using latest aem-project-archetype to create project on mac book terminal.

 

INFO] Executing META-INF/archetype-post-generate.groovy post-generation script [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.011 s [INFO] Finished at: 2025-06-07T22:46:22-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.3.1:generate (default-cli) on project standalone-pom: startup failed: [ERROR] Script1.groovy: 2: unable to resolve class groovy.util.XmlSlurper [ERROR] @ line 2, column 1. [ERROR] import groovy.util.XmlSlurper [ERROR] ^ [ERROR] [ERROR] 1 error [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

but getting below error.

INFO] Executing META-INF/archetype-post-generate.groovy post-generation script [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.011 s [INFO] Finished at: 2025-06-07T22:46:22-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.3.1:generate (default-cli) on project standalone-pom: startup failed: [ERROR] Script1.groovy: 2: unable to resolve class groovy.util.XmlSlurper [ERROR] @ line 2, column 1. [ERROR] import groovy.util.XmlSlurper [ERROR] ^ [ERROR] [ERROR] 1 error [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

I have

JDK 11

Maven 3.9.6

Groovy 4.0.27

 

Best answer by lukasz-m

Hi @amitsi18,

Please try to use older version - 3.2.1 - of maven-archetype-plugin in command for project creation. This should solve the issue. Here is sample command you could try to run:

mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate \
 -D archetypeGroupId=com.adobe.aem \
 -D archetypeArtifactId=aem-project-archetype \
 -D archetypeVersion=52\
 -D appTitle="My Site" \
 -D appId="mysite" \
 -D groupId="com.mysite"

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
June 8, 2025

Hi @amitsi18,

Please try to use older version - 3.2.1 - of maven-archetype-plugin in command for project creation. This should solve the issue. Here is sample command you could try to run:

mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate \
 -D archetypeGroupId=com.adobe.aem \
 -D archetypeArtifactId=aem-project-archetype \
 -D archetypeVersion=52\
 -D appTitle="My Site" \
 -D appId="mysite" \
 -D groupId="com.mysite"