Create AEM Project using Maven Archetype

DevJunctionPoint
0


Prerequisites.

  • Have access to an Adobe Experience Manager instance/jar. You will need  AEM 6.5 or AEM Cloud.
  • JAVA 11 (Recommended)
  • Maven

Creating settings.xml file.

  • Look for the .m2 folder inside your user for your particular Operating System
  • C:\Users\<YOUR-USERNAME>\.m2\settings.xml for Windows
  • If it is not there create settings.xml under the .m2 folder
<settings
    xmlns="https://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <profiles>
        <!-- ====================================================== -->
        <!-- A D O B E   P U B L I C   P R O F I L E                -->
        <!-- ====================================================== -->
        <profile>
            <id>adobe-public</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
                <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
                <releaseRepository-URL>https://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL>
            </properties>
            <repositories>
                <repository>
                    <id>adobe-public-releases</id>
                    <name>Adobe Public Repository</name>
                    <url>https://repo.adobe.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>adobe-public-releases</id>
                    <name>Adobe Public Repository</name>
                    <url>https://repo.adobe.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>adobe-public</activeProfile>
    </activeProfiles>
</settings>


Create Your Project With Archetype.
  • Open your terminal and paste the command.
mvn -B archetype:generate \
-D archetypeGroupId=com.adobe.aem \
-D archetypeArtifactId=aem-project-archetype \
-D archetypeVersion=35\
-D appTitle="My Site" \
-D appId="mysite" \
-D groupId="com.mysite" \
-D aemVersion=cloud

  • Archetype Version (You can use the latest version) 
    • -D archetypeVersion=35
  • Title Of The Website.
    • -D appTitle="My Site"
  • Your project folder name.
    • -D appId="mysite"
  • Project Package Name
    • -D groupId="com.mysite"
  • Version of AEM
    • -D aemVersion=cloud
  • Or
    • -D aemVersion=6.5.7
  • Once Project creation is complete you find the below screen in the folder.


Let’s try to understand all submodules get created inside the mysite project.



  • ui.apps package creates an empty inside /apps/practice and /etc/practice hierarchy and is responsible for component, OSGI configs, clientlibs, and internationalization.


  • ui.content package creates an empty inside /content/practice and /content/dam/practice hierarchy and responsible for content, pages, assets, content, templates, and experience fragment.
  • ui.frontend package is mainly responsible for front related items such as css, js and other resources.
  • core package is mainly responsible for Java or backend code. Jar file will get install in AEM instance as part of practice.all-1.0.0-SNAPSHOT.zip package.




  • Below is the location of project core jar file having all backend code.

  • ui.config package is responsible for defining run modes. Previously, it was a part of a ui.apps package and a small change in the configuration required a complete ui.apps package build. Using ui.config package we will be able to deploy the config only.




Tags

Post a Comment

0Comments

Do leave your comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!
To Top