/aem-cif-project-archetype

Maven template to create new CIF Project AEM projects that follow best practices

Primary LanguageCSSApache License 2.0Apache-2.0

CircleCI Maven Central GitHub

CIF Project Archetype

⚠️ NOTE: The CIF Project Archetype has been merged with AEM Project Archetype. For new CIF projects, use AEM Project Archetype as the starting point. The sample store-front project has been extracted from the CIF Archetype (after v0.11.0) and is now available in a separate GitHub repository. For more details, refer to CIF Venia Reference Site Readme.

This archetype creates a minimal Adobe Experience Manager CIF project as a starting point for your own projects using CIF core components. The properties that must be provided when using this archetype allow to name as desired all parts of this project.

This project is based on aem-project-archetype.

Provided Maven profiles

The generated maven project supports different deployment profiles when running the Maven install goal mvn install within the reactor.

Id Description
autoInstallBundle Install core bundle with the maven-sling-plugin to the Felix console
autoInstallPackage Install the ui.content and ui.apps content package with the content-package-maven-plugin to the package manager to default author instance on localhost, port 4502. Hostname and port can be changed with the aem.host and aem.port user-defined properties.
autoInstallPackagePublish Install the ui.content and ui.apps content package with the content-package-maven-plugin to the package manager to default publish instance on localhost, port 4503. Hostname and port can be changed with the aem.host and aem.port user-defined properties.

Usage

To use a released version of this archetype use the following Maven command:

mvn archetype:generate \
    -DarchetypeGroupId=com.adobe.commerce.cif \
    -DarchetypeArtifactId=cif-project-archetype \
    -DarchetypeVersion=x.y.z

Where x.y.z is the archetype version number that you want to use (see archetype versions). Generated projects depend on the CIF Connector. By default, the CIF Connector is not included in the generated project and must be installed separately. For on-prem installations only, we recommend to embed the CIF connector into your project. This can be achieved by generating a project using the -DoptionEmbedConnector=y option.

So make sure you have a compatible version (see requirements below) installed on your AEM instance.

Available properties

Name Default Description
groupId Base Maven groupId
artifactId Base Maven ArtifactId
version Version
package Java Source Package
appsFolderName /apps folder name
artifactName Maven Project Name
componentGroupName AEM component group name
contentFolderName /content folder name
confFolderName /conf folder name
packageGroup Content Package Group name
siteName AEM site name
optionAemVersion 6.5.0 Target AEM version
optionIncludeExamples y Include sample content package
optionEmbedConnector n Embed CIF connector in all package

Note: If the archetype is executed in interactive mode the first time properties with default values can't be changed (see ARCHETYPE-308 for more details). The value can be changed when the property confirmation at the end is denied and the questionnaire gets repeated or by passing the parameter in the command line (e.g. -DoptionIncludeExamples=n).

Requirements

The latest version of the AEM CIF Project Archetype, requires the below minimum system requirements:

Archetype AEM 6.4 AEM 6.5 Magento CIF Connector Java
0.11.0 6.4.4.0 6.5.0 2.3.4 / 2.3.5 1.0.0 1.8
  • Apache Maven (3.3.9 or newer)
  • Adobe Public Maven Repository in maven settings, see Knowledge Base article for details.

For a list of requirements for previous versions, see Historical System Requirements.

Building

To compile and use an edge, local version of this archetype:

mvn clean install

Then change to the directory in which you want to create the project and run:

mvn archetype:generate \
    -DarchetypeGroupId=com.adobe.commerce.cif \
    -DarchetypeArtifactId=cif-project-archetype \
    -DarchetypeVersion=x.y.z-SNAPSHOT

Side note: The profile "adobe-public" must be activated when using profiles like "autoInstallPackage" mentioned above.

Releases to Maven Central

Releases of this project are triggered by manually running mvn release:prepare release:clean on the master branch on the root folder of this repository. Once you choose the release and the next snapshot versions, this commits the change along with a release git tag like for example cif-project-archetype-x.y.z. Note that the commits are not automatically pushed to the git repository, so you have some time to check your changes and then manually push them. The push then triggers a dedicated CircleCI build that performs the deployment of the tagged artifact to Maven Central.

Demo Project

For demo purposes, we generate a sample store-front project. This project has been extracted from the CIF Archetype (after v0.11.0) and is now available in a separate GitHub repository. You can download for the latest package from CIF Venia Reference Site. This package includes the latest CIF Core Components version. However, it requires the installation of the CIF Connector. For more details, refer to CIF Venia Reference Site Readme.

The store-front requires an AEM dispatcher with forwarding rules specific to your Magento setup. Please follow the steps as described in the dispatcher documentation.