Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Trouble with maven archetype - Failed to execute goal org.apache.maven.plugins

Avatar

Former Community Member
Hi All,
 
I've been trying to set up a project using the Adobe Maven archetype for CQ.I've followed exactly the steps in this "http://dev.day.com/docs/en/cq/aem-how-tos/development/how-to-build-aem-projects-using-apache-maven.html" to build a AEM project.

But i have been getting "BUILD FAILURE" when i run the below mvn command

mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DgroupId=my-group-id -DartifactId=myproject -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany.myproject -DappsFolderName=myproject -DartifactName="My Project" -DcqVersion="5.6.1" -DpackageGroup="my Company" -e

here is the error message

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:multimodule-content-package-archetype:1.0.2)

I have also included both repository and a pluginRepository as below
 

<repositories>

                  <repository>

                    <id>adobe</id>

                    <name>Nexus Proxy Repository</name>

                    <url>http://repo.adobe.com/nexus/content/groups/public/</url>

                    <layout>default</layout>

                  </repository>

                </repositories>

                <pluginRepositories>

                  <pluginRepository>

                    <id>adobe</id>

                    <name>Nexus Proxy Repository</name>

                    <url>http://repo.adobe.com/nexus/content/groups/public/</url>

                    <layout>default</layout>

                  </pluginRepository>

                </pluginRepositories>

 

Please suggest me

 

Regards,

Anderson

1 Accepted Solution

Avatar

Correct answer by
Level 10

Yes -- its working - just executed this:

C:\AdobeCQ>%M2_HOME%\bin\mvn archetype:generate -DarchetypeGroupId=com.day.jcr.v
ault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVers
ion=1.0.0 -DarchetypeRepository=adobe-public-releases
[INFO] Scanning for projects...
Downloading: http://repo.dev.day.com/central/org/apache/maven/plugins/maven-meta
data.xml
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metada
ta.xml
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/apache/mav
en/plugins/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadat
a.xml (12 KB at 10.8 KB/sec)
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/codehaus/m
ojo/maven-metadata.xml
Downloading: http://repo.dev.day.com/central/org/codehaus/mojo/maven-metadata.xm
l
Downloading: http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (
22 KB at 131.0 KB/sec)
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/apache/mav
en/plugins/maven-archetype-plugin/maven-metadata.xml
Downloading: http://repo.dev.day.com/central/org/apache/maven/plugins/maven-arch
etype-plugin/maven-metadata.xml
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
Downloading: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-archety
pe-plugin/maven-metadata.xml (701 B at 5.2 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>
>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<
<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
Define value for property 'groupId': : testSept
Define value for property 'artifactId': : Sept
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  testSept: : com.sept
Define value for property 'appsFolderName': : Sept
Define value for property 'artifactName': : Sept
Define value for property 'packageGroup': : Sept
Confirm properties configuration:
groupId: testSept
artifactId: Sept
version: 1.0-SNAPSHOT
package: com.sept
appsFolderName: Sept
artifactName: Sept
packageGroup: Sept
 Y: : Y
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Archetype: multimodu
le-content-package-archetype:1.0.0
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: testSept
[INFO] Parameter: artifactId, Value: Sept
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.sept
[INFO] Parameter: packageInPathFormat, Value: com/sept
[INFO] Parameter: package, Value: com.sept
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: testSept
[INFO] Parameter: packageGroup, Value: Sept
[INFO] Parameter: appsFolderName, Value: Sept
[INFO] Parameter: artifactName, Value: Sept
[INFO] Parameter: artifactId, Value: Sept
[INFO] Parent element not overwritten in C:\AdobeCQ\Sept\bundle\pom.xml
[INFO] Parent element not overwritten in C:\AdobeCQ\Sept\content\pom.xml
[INFO] project created from Archetype in dir: C:\AdobeCQ\Sept
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.547s
[INFO] Finished at: Wed Sep 04 09:09:32 EDT 2013
[INFO] Final Memory: 10M/184M
[INFO] ------------------------------------------------------------------------

 

 

Its back working today. 

View solution in original post

10 Replies

Avatar

Level 8

Hi Anderson, I couldn't reproduce your problem...I used the command that you provided above (copy and paste into terminal) and it worked OK.

 

scott

Avatar

Former Community Member

It seems like the archetype is back online on your Nexus today, but yesterday a lot of stuff in com/day/jcr/vault was nuked - including the content-package-maven-plugin (which is back up again today), and the maven-vault-plugin / vault-maven-plugin (which aren't back up yet - but are still referenced in your Advanced Developer course material... guess how much course time we lost yesterday because of that?).

Avatar

Level 10

Try to delete your Maven Repo and re-install it. Follow these directions (copied from an AEM How TO):
 

Setup Maven in your development environment

You can use Maven to build an OSGi bundle that contains a Sling Servlet. Maven manages required JAR files that a Java project needs in its class path. Instead of searching the Internet trying to find and download third-party JAR files to include in your project’s class path, Maven manages these dependencies for you.

You can download Maven 3 from the following URL:

http://maven.apache.org/download.html

After you download and extract Maven, create an environment variable named M3_HOME. Assign the Maven install location to this environment variable. For example:

C:\Programs\Apache\apache-maven-3.0.4

Set up a system environment variable to reference Maven. To test whether you properly setup Maven, enter the following Maven command into a command prompt:

%M3_HOME%\bin\mvn -version

This command provides Maven and Java install details and resembles the following message:

Java home: C:\Programs\Java64-6\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

 

 

Create an Adobe CQ archetype project 

You can create an Adobe CQ archetype project by using the Maven archetype plugin. In this example, assume that the working directory is C:\AdobeCQ. 

 
Default files created by the Maven archetype plugin
 

To create an Adobe CQ archetype project, perform these steps:

 

1. Open the command prompt and go to your working directory (for example, C:\AdobeCQ).

2. Run the following Maven command:
mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.0 -DarchetypeRepository=adobe-public-releases

 

3. When prompted for additional information, specify these values:

 

  • groupId: com.adobe.cq.sling
  • artifactId: claim
  • version: 1.0-SNAPSHOT
  • package: com.adobe.cq.sling
  • appsFolderName: adobe-training
  • artifactName: Claim Training Package
  • packageGroup: adobe training
  • confirm: Y

 

4. Once done, you will see a message like:
[[INFO] Total time: 14:46.131s
[INFO] Finished at: Wed Mar 27 13:38:58 EDT 2013
[INFO] Final Memory: 10M/184M

Avatar

Correct answer by
Level 10

Yes -- its working - just executed this:

C:\AdobeCQ>%M2_HOME%\bin\mvn archetype:generate -DarchetypeGroupId=com.day.jcr.v
ault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVers
ion=1.0.0 -DarchetypeRepository=adobe-public-releases
[INFO] Scanning for projects...
Downloading: http://repo.dev.day.com/central/org/apache/maven/plugins/maven-meta
data.xml
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metada
ta.xml
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/apache/mav
en/plugins/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadat
a.xml (12 KB at 10.8 KB/sec)
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/codehaus/m
ojo/maven-metadata.xml
Downloading: http://repo.dev.day.com/central/org/codehaus/mojo/maven-metadata.xm
l
Downloading: http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (
22 KB at 131.0 KB/sec)
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.adobe.com/archiva/repository/day-central/org/apache/mav
en/plugins/maven-archetype-plugin/maven-metadata.xml
Downloading: http://repo.dev.day.com/central/org/apache/maven/plugins/maven-arch
etype-plugin/maven-metadata.xml
Downloading: http://dev.cqblueprints.com/nexus/content/repositories/releases/org
/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
Downloading: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/maven-metadata.xml
Downloaded: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-archety
pe-plugin/maven-metadata.xml (701 B at 5.2 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>
>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<
<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
Define value for property 'groupId': : testSept
Define value for property 'artifactId': : Sept
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  testSept: : com.sept
Define value for property 'appsFolderName': : Sept
Define value for property 'artifactName': : Sept
Define value for property 'packageGroup': : Sept
Confirm properties configuration:
groupId: testSept
artifactId: Sept
version: 1.0-SNAPSHOT
package: com.sept
appsFolderName: Sept
artifactName: Sept
packageGroup: Sept
 Y: : Y
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Archetype: multimodu
le-content-package-archetype:1.0.0
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: testSept
[INFO] Parameter: artifactId, Value: Sept
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.sept
[INFO] Parameter: packageInPathFormat, Value: com/sept
[INFO] Parameter: package, Value: com.sept
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: testSept
[INFO] Parameter: packageGroup, Value: Sept
[INFO] Parameter: appsFolderName, Value: Sept
[INFO] Parameter: artifactName, Value: Sept
[INFO] Parameter: artifactId, Value: Sept
[INFO] Parent element not overwritten in C:\AdobeCQ\Sept\bundle\pom.xml
[INFO] Parent element not overwritten in C:\AdobeCQ\Sept\content\pom.xml
[INFO] project created from Archetype in dir: C:\AdobeCQ\Sept
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.547s
[INFO] Finished at: Wed Sep 04 09:09:32 EDT 2013
[INFO] Final Memory: 10M/184M
[INFO] ------------------------------------------------------------------------

 

 

Its back working today. 

Avatar

Community Advisor

Hi,

I have followed the same steps even facing same issue "The desired archetype does not exist (org.apache.maven.archetypes:multimodule-content-package-archetype:1.0.2)"

It seems to be issue with setting.xml  configuration for Maven.

Could any one of you please share you setting.xml  ?

Regards

Brijesh Yadav

Avatar

Former Community Member

The archetype is back, yes, but the maven-vault-plugin isn't - you'll probably want to ping somebody to either fix that, or fix the CQ5 Advanced Developer Training material...

Also, to anybody depending on the Adobe public repository: be sure to set up your own Nexus repository and make it proxy the adobe repository, to reduce headaches the next time something blows up.

Avatar

Former Community Member

Thanks.. It started to work now. I did not do any changes. It was a problem with adobe repo.It seemed like folders have been updated within the last few days and the archetypes have been moved/removed...again thanks for your all informations.

Avatar

Community Advisor

Now its working because "multimodule-content-package-archetype" available in repository 

[img]Image.png[/img]

Regards

Brijesh Yadav

Avatar

Level 6

The instructions for creating a CQ archetype fail with:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.day.jcr.vault:multimodule-content-package-archetype:1.0.0) -> [Help 1]

Avatar

Level 6

I found the solution.  You must add -Padobe-public to the command.  In the past, this:

-DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/

worked, but not anymore.  See here:

Maven Archetype Plugin – Archetype Repository

Where it says "As of Maven Archetype Plugin 3.0.0 the archetype resolution has changed. It is not possible anymore to specify the repository via the commandline"

The command line proposed in the Adobe article omits the -P switch, which tells mvn which profile to use.  The repository is specified in the adobe-public profile.