Creating AEM project using Maven Archetype

before creating AEM project make sure you have set
JAVA_HOME: C:\Program Files\AdoptOpenJDK\jdk-8.0.202.08
M2_HOME: C:\ApacheMaven_3.5.2

also make sure your settings.xml file is ready at .m2 path C:\Users\user_name\.m2 or under C:\ApacheMaven_3.5.2\conf
if not ready do the needful changes.

below is the adobes public profile you can add to settings.xml file
</profiles>
<profile>
    <id>adobe-public</id>
    <activation>
              <activeByDefault>true</activeByDefault>
      </activation>
      <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>
   </profile>
</profiles>

Now go to the folder where you want to create project and open command prompt
Enter below 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=com.aem.community -DartifactId=learnaem -Dversion=1.0-SNAPSHOT -Dpackage=com.aem.community -DappsFolderName=AEMProject -DartifactName="AEM Project" -DcqVersion="6.3" -DpackageGroup="AEM Project"

press Enter key it will start creating maven project
when prompted press y to continue creation


while creating project if you face the issue like The desired archetype does not exist (com.day.jcr.vault:multimodule-content-package-archetype:1.0.2)
it should resolved with adobes public profile but even then you face it download the multimodule-content-package-archetype-[version in my case its 1.0.2]1.0.2.pom from https://repo.adobe.com/nexus/content/groups/public/com/day/jcr/vault/multimodule-content-package-archetype/1.0.2/multimodule-content-package-archetype-1.0.2.pom and save it in your local drive under below .m2 path
C:\Users\userName\.m2\repository\com\day\jcr\vault\multimodule-content-package-archetype\1.0.2

Now you can import this project in your eclipse and work on it

KEEP EDUCATING YOURSELF!!!!

Comments

Popular posts from this blog

AEM in docker

Sling API vs JCR API

Creating or finding .M2 folder