Error while building maven archetype 24 | Community
Skip to main content
Level 3
January 3, 2022
Solved

Error while building maven archetype 24

  • January 3, 2022
  • 5 replies
  • 21853 views

Command:

 

mvn -B archetype:generate 

 -D archetypeGroupId=com.adobe.aem 

 -D archetypeArtifactId=aem-project-archetype 

 -D archetypeVersion=24 

 -D aemVersion=6.5.0 

 -D appTitle="My Site" 

 -D appId="mysite" 

 -D groupId="com.mysite" 

 -D frontendModule=general 

 -D includeExamples=n

 

Error:

 

[WARNING] CP Don't override file /Users/test/mysite/ui.tests/test-module/wdio.conf.commons.js

[INFO] Parent element not overwritten in /Users/test/mysite/ui.apps.structure/pom.xml

[INFO] Executing META-INF/archetype-post-generate.groovy post-generation script

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  12.651 s

[INFO] Finished at: 2022-01-04T02:22:04+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: startup failed:

[ERROR] General error during conversion: Conflicting module versions. Module [groovy-all is loaded in version 2.4.16 and you are trying to load version 2.4.8

[ERROR] 

[ERROR] groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.16 and you are trying to load version 2.4.8

[ERROR] at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:529)

[ERROR] at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:81)

[ERROR] at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerExtensionModuleFromProperties(MetaClassRegistryImpl.java:174)

[ERROR] at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$registerExtensionModuleFromProperties.call(Unknown Source)

[ERROR] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sankarr26533925

Thanks @santoshsai @arunpatidar @edodemuru for your comments.

 

Due to maven-archetype-plugin version 3.2.1, pom file has 2.4.16 version for groovy-all

 

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.16</version>
<scope>compile</scope>
</dependency>

 

.m2/repository/org/apache/maven/archetype/archetype-common/3.2.1/archetype-common-3.2.1.pom:      <version>2.4.16</version>

 

post-generate groovy using 2.4.8 version in below annotation. This is creating conflict and showing the error. 

@Grab(group="org.codehaus.groovy", module="groovy-all", version="2.4.8")

 

https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-post-generate.groovy

 

To resolve this issue using workaround, I updated 2.4.8 version in below POM under local .m2 repository. This might help someone in future

.m2/repository/org/apache/maven/archetype/archetype-common/3.2.1/archetype-common-3.2.1.pom

 

Am not sure how this is working for others

 

5 replies

January 4, 2022

Hi,

I had the same issue and I fixed it going on my local maven repository, under the 

.m2\repository\org\codehaus\groovy folder and manually deleted the 2.4.16 version of the grovy-all and of the groovy dependency installed there.

This worked for me, maybe it can help you too.

 

 

Level 3
January 4, 2022

I tried it earlier and not works for me

arunpatidar
Community Advisor
Community Advisor
January 4, 2022
Level 3
January 4, 2022

I believe that gradle need not be installed for creating sample project using maven archetype. Please correct me if my understanding is incorrect.

SantoshSai
Community Advisor
Community Advisor
January 4, 2022

Hi @sankarr26533925 

Could you please try this below command by including the word sudo to the build maven command?

sudo mvn -B archetype:generate 

 -D archetypeGroupId=com.adobe.aem 

 -D archetypeArtifactId=aem-project-archetype 

 -D archetypeVersion=24 

 -D aemVersion=6.5.0 

 -D appTitle="My Site" 

 -D appId="mysite" 

 -D groupId="com.mysite" 

 -D frontendModule=general 

 -D includeExamples=n

Regards,

Santosh

Santosh Sai
Level 3
January 4, 2022

Same error using your command too.

sankarr26533925AuthorAccepted solution
Level 3
January 4, 2022

Thanks @santoshsai @arunpatidar @edodemuru for your comments.

 

Due to maven-archetype-plugin version 3.2.1, pom file has 2.4.16 version for groovy-all

 

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.16</version>
<scope>compile</scope>
</dependency>

 

.m2/repository/org/apache/maven/archetype/archetype-common/3.2.1/archetype-common-3.2.1.pom:      <version>2.4.16</version>

 

post-generate groovy using 2.4.8 version in below annotation. This is creating conflict and showing the error. 

@Grab(group="org.codehaus.groovy", module="groovy-all", version="2.4.8")

 

https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-post-generate.groovy

 

To resolve this issue using workaround, I updated 2.4.8 version in below POM under local .m2 repository. This might help someone in future

.m2/repository/org/apache/maven/archetype/archetype-common/3.2.1/archetype-common-3.2.1.pom

 

Am not sure how this is working for others

 

January 6, 2022

Thanks @sankarr26533925 : This worked for me.

anand89
June 8, 2022

Hi @sankarr26533925 

This is fixed as an issue at https://github.com/adobe/aem-project-archetype/issues/857

Just use maven archetype plugin 3.2.0 like below 

example:

 

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

 

Level 6
June 13, 2022

Hi @anand89 

tried with above command 

but getting this error