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

Unable to build the AEM project using Maven

Avatar

Level 3

I am using the cmd to create 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=com.adobe.cq -DartifactId=key61 -Dversion=1.0-SNAPSHOT -Dpackage=com.adobe.cq -DappsFolderName=myproject -DartifactName="My Project" -DcqVersion="5.6.1" -DpackageGroup="My Company"

but getting error while downloading the jar file.attached the error screen shot.

Tried opening the path :https://repo.adobe.com/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/... but getting the below error.Please suggest

404 - Path /org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom not found in group repository "Public Repositories" [id=public].

Path /org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom not found in group repository "Public Repositories" [id=public].

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi ramyan60274153

Please its working fine for me too.

Please make sure of following prerequisites:-

  • Apache Maven 3.0.4 or higher
  • Oracle Java SE 1.5.x or higher
  • CQ5.5, AEM 5.6 or higher

Please find below fer good reference to follow for building maven projects :-

Link:- https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-...

Link:- https://helpx.adobe.com/experience-manager/using/first-osgi.html

Link:- http://cq-ops.tumblr.com/post/31404223822/how-to-use-apache-maven-to-build-and-deploy-osgi

//

Here are the steps to get you set up:

1) If you haven’t done so yet, install and configure a 1.7 JDK.  Instructions here.

2) Download Apache Maven

3) Unzip to a folder.  Eg.  C:\Programs\Apache\Maven

4) Create separate folder for the Maven Repository - separate so that you can update Maven with a newer version without affecting the repo.  Eg. C:\Programs\Apache\Maven\local_repo

5) Configure system environment variables M2_HOME(C:\Programs\Apache\Maven\apache-maven-3.0.4) and M2_REPO(C:\Programs\Apache\Maven\local_repo)

6) Add the /bin folder of Maven to the beginning of the existing system environment variable Path as e.g. %M2_HOME%\bin;

7) Start a command prompt and test whether maven is working.

mvn –version

You should get a response such as this:

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Programs\Apache\Maven\apache-maven-3.0.4
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
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”

8) Run the following command:

mvn archetype:generate

When it prompts to confirm, cancel.

9) Copy the Maven configuration file settings.xml from C:\Programs\Apache\Maven\apache-maven-3.2.1\conf\ to your Windows user profile.  Eg. C:\Users\JAYAN\.m2\

7) Edit settings.xml to configure the local repository.  Eg:

<localRepository>C:\Programs\Apache\Maven\local_repo</localRepository>

8) Follow instructions here.

 

I hope this would work for you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

3 Replies

Avatar

Employee

Hi Ramya,

I just tried the above command and it worked for me. According to [1], you need maven 3 or above, what version are you using?

Regards,

Opkar

[1] https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-...

Avatar

Correct answer by
Administrator

Hi ramyan60274153

Please its working fine for me too.

Please make sure of following prerequisites:-

  • Apache Maven 3.0.4 or higher
  • Oracle Java SE 1.5.x or higher
  • CQ5.5, AEM 5.6 or higher

Please find below fer good reference to follow for building maven projects :-

Link:- https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-...

Link:- https://helpx.adobe.com/experience-manager/using/first-osgi.html

Link:- http://cq-ops.tumblr.com/post/31404223822/how-to-use-apache-maven-to-build-and-deploy-osgi

//

Here are the steps to get you set up:

1) If you haven’t done so yet, install and configure a 1.7 JDK.  Instructions here.

2) Download Apache Maven

3) Unzip to a folder.  Eg.  C:\Programs\Apache\Maven

4) Create separate folder for the Maven Repository - separate so that you can update Maven with a newer version without affecting the repo.  Eg. C:\Programs\Apache\Maven\local_repo

5) Configure system environment variables M2_HOME(C:\Programs\Apache\Maven\apache-maven-3.0.4) and M2_REPO(C:\Programs\Apache\Maven\local_repo)

6) Add the /bin folder of Maven to the beginning of the existing system environment variable Path as e.g. %M2_HOME%\bin;

7) Start a command prompt and test whether maven is working.

mvn –version

You should get a response such as this:

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Programs\Apache\Maven\apache-maven-3.0.4
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
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”

8) Run the following command:

mvn archetype:generate

When it prompts to confirm, cancel.

9) Copy the Maven configuration file settings.xml from C:\Programs\Apache\Maven\apache-maven-3.2.1\conf\ to your Windows user profile.  Eg. C:\Users\JAYAN\.m2\

7) Edit settings.xml to configure the local repository.  Eg:

<localRepository>C:\Programs\Apache\Maven\local_repo</localRepository>

8) Follow instructions here.

 

I hope this would work for you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

Hi Ramya,

Here is a very good article for building the first AEM project using Maven: https://helpx.adobe.com/experience-manager/using/first-osgi.html

It perfectly works for me!!

Thanks,
Ratna Kumar.