Error while building maven archetype 24 | Community
Skip to main content
Level 3
Jan 3, 2022 9:03 PM UTC
Solved

Error while building maven archetype 24

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.
sankarr26533925Accepted solution
Level 3
Jan 4, 2022 8:10 PM UTC

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

 

16 replies

anand89
New Participant
Jun 8, 2022 7:37 AM UTC

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"

 

Translate
Level 6
Jun 13, 2022 9:08 AM UTC

Hi @anand89 

tried with above command 

but getting this error

 

Translate
sankarr26533925AuthorAccepted solution
Level 3
Jan 4, 2022 8:10 PM UTC

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

 

Translate
New Participant
Jan 6, 2022 10:36 AM UTC

Thanks @sankarr26533925 : This worked for me.

Translate
SantoshSai
New Participant
Jan 4, 2022 7:06 PM UTC

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

Translate
Santosh Sai
Level 3
Jan 4, 2022 8:13 PM UTC

Same error using your command too.

Translate
arunpatidar
New Participant
Jan 4, 2022 3:01 PM UTC
Arun Patidar
Level 3
Jan 4, 2022 8:13 PM UTC

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

Translate
New Participant
Jan 4, 2022 2:31 PM UTC

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.

 

 

Translate
Level 3
Jan 4, 2022 8:11 PM UTC

I tried it earlier and not works for me

Translate