archetype 23 build new aem project failing

sreedobe

24-06-2020

Hello All,

 

I am trying to execute following in a virtual box to create a new maven aem project on 6.5 , maven 3.3.9

 

$ mvn -B archetype:generate  -D archetypeGroupId=com.adobe.granite.archetypes  -D archetypeArtifactId=aem-project-archetype  -D archetypeVersion=23  -D aemVersion=6.5.0  -D appTitle="Personal Investor Website"  -D appId="pi-web"  -D groupId="com.trp.aem.iinvestor"  -D frontendModule=general  -D includeExamples=n
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:3.1.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:3.1.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:3.1.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repository with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: aem-project-archetype:23
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.trp.aem.iinvestor
[INFO] Parameter: artifactId, Value: pi-web
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.trp.aem.iinvestor
[INFO] Parameter: packageInPathFormat, Value: com/trp/aem/iinvestor
[INFO] Parameter: aemVersion, Value: 6.5.0
[INFO] Parameter: appTitle, Value: Personal Investor Website
[INFO] Parameter: groupId, Value: com.trp.aem.iinvestor
[INFO] Parameter: includeExamples, Value: n
[INFO] Parameter: sdkVersion, Value: latest
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: includeErrorHandler, Value: n
[INFO] Parameter: includeDispatcherConfig, Value: y
[INFO] Parameter: frontendModule, Value: general
[INFO] Parameter: languageCountry, Value: en_us
[INFO] Parameter: package, Value: com.trp.aem.iinvestor
[INFO] Parameter: singleCountry, Value: y
[INFO] Parameter: artifactId, Value: pi-web
[INFO] Parameter: appId, Value: pi-web
[INFO] Parent element not overwritten in /projects/workspace/pi-web/all/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/core/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/dispatcher.ams/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/dispatcher.cloud/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.frontend.general/pom.xml
[WARNING] Don't override file /projects/workspace/pi-web/ui.frontend.general/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.frontend.angular/pom.xml
[WARNING] Don't override file /projects/workspace/pi-web/ui.frontend.angular/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.frontend.react/pom.xml
[WARNING] Don't override file /projects/workspace/pi-web/ui.frontend.react/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.apps/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.content/pom.xml
[WARNING] CP Don't override file /projects/workspace/pi-web/ui.content/src/main/content/jcr_root/content/pi-web/_jcr_content/image/file
[INFO] Parent element not overwritten in /projects/workspace/pi-web/it.tests/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/it.launcher/pom.xml
[INFO] Parent element not overwritten in /projects/workspace/pi-web/ui.apps.structure/pom.xml
[INFO] Executing META-INF/archetype-post-generate.groovy post-generation script
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.196 s
[INFO] Finished at: 2020-06-24T22:33:19+00:00
[INFO] Final Memory: 25M/369M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project standalone-pom: startup failed:
[ERROR] General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.codehaus.groovy#groovy-all;2.4.8: not found]
[ERROR] 
[ERROR] java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.codehaus.groovy#groovy-all;2.4.8: not found]
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[ERROR] at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
[ERROR] at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
[ERROR] at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
[ERROR] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:250)
[ERROR] at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:422)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
[ERROR] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
[ERROR] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
[ERROR] at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:569)
[ERROR] at groovy.grape.GrapeIvy$resolve$1.callCurrent(Unknown Source)
[ERROR] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:193)
[ERROR] at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:536)
[ERROR] at groovy.grape.GrapeIvy$resolve$0.callCurrent(Unknown Source)
[ERROR] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
[ERROR] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
[ERROR] at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:254)
[ERROR] at groovy.grape.Grape.grab(Grape.java:167)
[ERROR] at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:376)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:346)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
[ERROR] at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
[ERROR] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
[ERROR] at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
[ERROR] at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
[ERROR] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:573)
[ERROR] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:612)
[ERROR] at groovy.lang.GroovyShell.evaluate(GroovyShell.java:583)
[ERROR] at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:234)
[ERROR] at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:133)
[ERROR] at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:104)
[ERROR] at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:148)
[ERROR] at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:163)
[ERROR] at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFromArchetype(DefaultArchetypeManager.java:75)
[ERROR] at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:203)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[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/MojoFailureException
trpe746@development:/projects/workspace$ 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Theo_Pendle

MVP

26-06-2020

Hi @sreedobe,

Finally I can access your question! 😉

Okay so the maven archetype uses Groovy in the last phase of the creation of the project files.

To get a dependency in groovy, you use the @Grab annotation. The one that is causing you trouble is on the first line of this file of the archetype: https://github.com/adobe/aem-project-archetype/blob/2f00f638b96853ef3f9041f0bb0fd5c6e739f453/src/mai...

I'll tell you right now that I'm far from being a groovy expert but I think this question on StackOverflow could be useful to you: https://stackoverflow.com/questions/16871792/groovy-grab-download-failed

Basically, groovy has a number of resolvers which will attempt to fetch dependencies in different locations. The location you want it to look in is the .groovy repository (which you can find in your home directory) not the .m2 repository. According to the SO question, it's possible that this is causing a conflict.

So:

  1. Is it possible that you have a ~/.groovy/grapeConfig.xml file which is telling groovy to look for dependencies in the wrong place?
  2. If yes, fix it.
  3. If not, then have a look at the answers to the SO question. The one by user "Mike" looks quite promising 🙂

Answers (0)