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.

Starting Construction Prepare Source

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 7.2.0 Developer Guide:
    1. Java 8 (JDK 1.8 64-bit) setup
    2. Maven 3.3.9 setup
    3. Configuring System Environment Variables

Unzip Source Release Packages

Elastic Path Commerce source code is delivered in the following release package:

Release Package Contents
EP-Commerce-7.2.0.zip Core Commerce, Cortex
  • Unzip the contents of the release package into your project source directory.

Add Project to Source Control

Warning: Windows File Path Limitation

Do not save your source project 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.

  1. Add all files in the ep-commerce directory to source control.
    Tip:

    If you are using Git, line endings need to be converted to LF on input.

    The command to configure this is:
    git config --global core.autocrlf input
  2. Create a development branch in the project repository. The branch name depends on your SCM and branch naming conventions.

Configure the extension Module's settings.xml File

The extensions module you just added to source control has a maven/settings.xml file the project teams will use.

  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 changes required for your project environment.
  3. Commit the changes to source control.
  4. Copy the settings.xml to your ${user.home}/.m2 directory.

Re-version Modules for Development

Elastic Path release packages contain modules with RELEASE versions. Prior to starting development, the modules must be reversioned to SNAPSHOT versions using scripts provided in the devops module.

Tip:

On Windows, use either Git Bash, MinGW, or Cygwin to run the script.

To re-version modules for development:

  1. Make sure that:
    • Module directories have the same names as ones provided in source release packages.
    • The development branch is checked out.
  2. Run the following script to re-version code.
    cd <modules-parent-folder>
    ./devops/scripts/set-ep-versions.sh 702.0.0-SNAPSHOT 0.0.0-SNAPSHOT

Deliverables

  • All Elastic Path modules added to source control
  • Modules have development branches with SNAPSHOT versions
  • extensions/maven/settings.xml is configured correctly for local development