Project Setup for AEM as a Cloud Service (AEMaaCS) Or AEM Using Maven Archetype

Project Setup for AEM

1. Prerequisites.

  • Have access to an Adobe Experience Manager instance/jar. You will need aem 6.3 Service Pack 3, AEM 6.4 or AEM 6.5 or AEM Cloud.
  • JAVA 11 (Recomended)
  • Maven

2. 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
  • ~/.m2/settings.xml for Linux or Mac

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>

3. 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 latest version) Click Here For 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 (Or 6.3.0 Or 6.4.0)

4. Navigate To Your Project Folder.

$ cd mysite

5. Build The Package.

$ mvn clean install
or
$ mvn clean install -PautoInstallPackage
** “autoInstallPackage” is a default maven profile included in pom.xml which will build and deploy your project to AEM running on localhost.


Happy Coding!

About Sagor Chowdhuri 17 Articles
AEM Developer

Be the first to comment

Leave a Reply

Your email address will not be published.


*