Getting Started with AEM Sites
Prerequisites
A local development environment is necessary to complete this
tutorial.
The following is required:
1.
Java 1.8
2.
Apache Maven (3.3.9 or newer)
3.
AEM 6.4 + Service Pack 2 or
4.
AEM 6.3 + Service Pack 3
5.
Eclipse or other IDE
Create Project with Maven AEM Project Archetype 13
There are a couple options for creating a Maven
Multimodule project for AEM. This tutorial will leverage the Maven AEM Project Archetype 13.
Verify
Maven Version -> $ mvn -version
add an adobe-public profile
to your Maven settings.xml file in order to
automatically add repo.adobe.com to the maven build process.
Create a file
named settings.xml at ${user.home}/.m2/settings.xml if it
doesn't exist already.
Add the adobe-public profile to the settings.xml
|
</ |
Create Maven Archetype
|
mvn -B archetype:generate
-DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype
-DarchetypeVersion=13 -DaemVersion=6.4.0 -DappTitle="My Site"
-DappId="mysite" -DgroupId="com.mysite"
-DincludeExamples=y -DsingleCountry=n -DartifactId="mysite" |
Run on cmd or powershell |
|
Description |
Property |
Value |
|
Maven group id |
groupId |
com.mysite |
|
Maven artifact id |
artifactId |
mysite |
|
Starting version of project |
version |
0.0.1-SNAPSHOT |
|
Java source package |
package |
com.mysite |
|
/apps folder name |
appsFolderName |
mysite |
|
Maven project name |
artifactName |
mysite Project |
|
AEM component group name |
componentGroupName |
mysite.Content |
|
/conf folder name |
confFolderName |
mysite |
|
/content folder name |
contentFolderName |
mysite |
|
Prefix used in generated CSS |
cssId |
mysite |
|
Content Package group name |
packageGroup |
mysite |
|
AEM site name |
siteName |
mysite Site |
Build your project
|
$ cd mysite
$ mvn -PautoInstallPackage -Padobe-public clean
install |
Code is available on github
https://github.com/jaykrs/mysite
View Packages on
AEM
Navigate to
Package Manager on your local AEM instance: http://localhost:4502/crx/packmgr/index.jsp. You should see the following 5 packages installed:
Navigate to the AEM Sites Console: http://localhost:4502/sites.html
The mysite Site will be one of the sites. It will include two
content pages, one for English and one for French.
Inspecting the Project Structure
There are six areas to
the project:
1.
Parent POM - deploys maven modules and manages dependency versions
2.
core - Java bundle containing all core functionality like
OSGi services, listeners or schedulers, as well as component-related Java code
such as servlets or request filters.
3.
ui.apps - contains the /apps parts of the project, ie
JS&CSS clientlibs, components, runmode specific configs as well as
Hobbes-tests
4.
ui.content - contains structural content and configurations
(/content, /conf)
5.
ui.tests - Java bundle containing JUnit tests that are executed
server-side. This bundle is not to be deployed onto production.
6.
ui.launcher - contains glue code that deploys the ui.tests bundle (and
dependent bundles) to the server and triggers the remote JUnit execution
As of now our Basic AEM site with required project has been
created and running on AEM author server. Lets move on to create basic side
ready for template and css with layout.



Comments
Post a Comment