Expand my Community achievements bar.

SOLVED

Error while building maven archetype 24

Avatar

Level 4

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)

1 Accepted Solution

Avatar

Correct answer by
Level 4

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-po...

 

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

 

View solution in original post

16 Replies

Avatar

Level 1

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.

 

 

Avatar

Level 4

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

Avatar

Community Advisor

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

Avatar

Level 2

Using sudo to resolve issues like this should be discouraged, as you can create other issues such as file permissions etc later on down the line when you try to use mvn again.

Avatar

Correct answer by
Level 4

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-po...

 

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

 

Avatar

Level 1

Thanks bro! This helped me to resolve the issue I was facing to create a project.

you are my lifesaver. 

Avatar

Level 1

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"