Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Prepare Source Code

Prepare Source Code

Note: Role: Tech Lead
Dependent on By Documentation
Source control provisioning IT Operations Prepare Infrastructure
Maven repository setup Dev Ops Setup Maven Repository

Overview

This page describes how to prepare Elastic Path source code for use by your project. The diagram below shows the steps.

Note:

ep-aem-commerce and geometrixx-demo projects are only available with EP-Commerce-for-AMC-Spring-2015.zip package

Starting Construction Prepare Source Fall-2014-SP2

Setup local build environment

You will need a working Java build environment on your local computer to prepare the source code.

  1. Setup your build environment as described in the following sections of the Core Commerce 6.14.0 Developer Guide:
    1. Java 7 (JDK 1.7 64-bit) setup
    2. Maven 3.0.5 setup
    3. Configure your System Environment Variables

Unzip source release package

EP source is delivered as a single ZIP file. You should obtain one of the following release packages depending on your license and the environment you wish to create:

Release package Contents
EP-Commerce-for-AMC-Spring-2015.zip EP Commerce for Adobe Marketing Cloud, Cortex, Core Commerce
EP-Commerce-Spring-2015.zip Cortex, Core Commerce
EP-Core-Commerce-6.14.zip Core Commerce
  1. Unzip the contents of the release package into a local directory.
    Warning: Windows File Path Limitation

    Do not checkout your source code to a directory that is greater than 20 characters in length. Windows file paths are limited to 260 characters. The longest file path in the source code is greater than 230 characters so be careful where you deploy your source files.

Configure a temporary settings.xml

The source release package contains a settings.xml file in the extensions/maven folder.

  1. Copy the settings.xml to your ${user.home}/.m2 directory.
  2. Replace the <mirror> <url> at the the top of the file with the <Project> EP Repository Group URL documented during Setup Maven Repository.
    Warning:

    Do not reverse the order of these steps. You must first copy the file and then substitute the URL

Configure and run the Inception accelerator

The Inception Accelerator Kit enhances and customizes the EP release package. See Starting Construction Guide (Resources) if you don't have a copy.

  1. Unzip the accelerator into a local directory. On Windows the directory path must be less than 20 characters in length.
  2. Configure the following client-specific values in config/inception.properties.
    Property Description Example (Company Inc.)
    ep.release.package.directory

    The directory containing the unzipped EP release package

    Warning:

    On Windows, use either forward slashes or escaped backslashes. e,g. c:/ep/release-package c:\\ep\\release-package

    client.group.id

    The Maven groupId for extension project artifacts. It must follow the Java package name rules and start with a domain name you control.

    Warning:

    Do not use com.elasticpath as your groupId. This will result in conflicts between extension artifact names and product artifact names

    com.company.ep
    client.package.name The package name for Java source code com.company.ep
    client.package.directory The directory path corresponding to the package name for Java source code com/company/ep
  3. Run the Inception accelerator from the command line. The commands you execute depend on the release package being processed:
    Release package Commands
    EP-Commerce-for-AMC-Spring-2015.zip
    cd inception
    mvn clean package -Pwith-cortex,with-aem
    EP-Commerce-Spring-2015.zip
    cd inception
    mvn clean package -Pwith-cortex
    EP-Core-Commerce-6.14.zip
    cd inception
    mvn clean package

Add projects to source control

  1. Create a new folder for your project source.
    Warning: Windows File Path Limitation

    Do not checkout your source code to a directory that is greater than 20 characters in length. Windows file paths are limited to 260 characters. The longest file path in the source code is greater than 230 characters so be careful where you deploy your source files.

  2. Move the cmclient, commerce-engine, devops, extensions, (ep-aem-commerce & geometrixx-demo, if applicable) projects from inception/target to your project source folder.
  3. Add each project to source control as a separate project.
    Tip:

    If you use GitHub or a similar Git hosting service, follow the instructions in Add Source to GitHub.

  4. Create a development branch for each project. The branch name will depend on your SCM and branch naming conventions.
  5. Delete the unzipped EP release package. It is no longer needed.

Configure the project settings.xml

The extensions project you just added to source control has a maven/settings.xml file that will be used by the project team.

  1. Replace the <mirror> <url> at the the top of the file with the <Project> EP Repository Group URL documented during Setup Maven Repository.
  2. Make any other changes that are required by your project environment.
  3. Commit the changes to source control.
  4. Copy the settings.xml to your ${user.home}/.m2 directory, replacing the temporary one your created earlier.

Reversion projects for development

The EP release package contains projects with RELEASE versions. Prior to starting development the projects need to be reversioned to SNAPSHOT versions.

  1. Determine the version numbers to use for the development branch. See Construction Practices - Version Numbers for information on EP version number conventions and restrictions.
  2. Ensure each project is checked out under the development branch.
  3. Follow the steps in Construction Practices - Update Version Numbers.

Deliverables

  • All EP projects added to source control
  • Projects have development branches with SNAPSHOT versions
  • extensions/maven/settings.xml configured correctly for local development