Elastic Path Maven Commands
All Self-Managed Commerce modules are Maven modules with configurable pom.xml files. The POM files contain configuration details and dependency information required for building, installing, cleaning, packaging, and running modules in development and CI environments.
This page lists some of the commonly used Maven commands with Self-Managed Commerce.
note
When running Maven commands you may experience a java.lang.OutOfMemoryError: GC overhead limit exceeded error. To solve this issue increase the memory setting in the MAVEN_OPTS environment variable.
Building Source Code
To build the Self-Managed Commerce source, navigate to the source code root and execute one of these commands in the command line:
| Command | Description | Use Case | Approximate Build Time on 2021 MacBook M1 Pro |
|---|---|---|---|
mvn clean install | Build all modules and run all tests. | Not recommended for local builds; normally only be run in build pipelines. | 90+ minutes |
mvn clean install -DskipAllTests | Build all modules, skipping all tests and static analysis checks. | Building source code that is in a known good state so you can run the webapps. | 9 minutes |
mvn clean install -DskipAllTests -T0.5C | Build all modules using multiple threads, skipping all tests and static analysis checks. | Building source code that is in a known good state so you can run the webapps. | 5 minutes |
mvn clean install -DskipSlowTests | Build all modules and run static analysis checks and unit tests, skipping Integration tests and Cucumber tests. | Building source code that has been recently changed to verify that most issues are resolved. | 19 minutes |
mvnmin clean install -DskipSlowTests | Build modified modules and their dependents and run static analysis checks and unit tests, skipping Integration tests and Cucumber tests. You will need to install Maven Minimal first. | Building source code that has been recently changed to verify that most issues are resolved. | Depends on changes |
Running Webapps
To run a web application as a standalone process, navigate to the webapp module (e.g. extensions/cortex/ext-cortex-webapp) and execute one of these commands:
Run webapp without debugging
mvn clean package cargo:runRun webapp with external debugging on port
8000mvn clean package cargo:run -Pdebug
note
To run web applications as separate processes, the ep-developers profile must be active. For more information see Elastic Path Maven Profiles.
The ep-developers profile assigns the following web application ports:
8081- Commerce Manager8082- Search server8083- Integration server8084- Batch server9080- Cortex and Cortex Studio
Running ActiveMQ
The ActiveMQ broker can either be installed as a service on your computer or run from the command line from extensions/activemq-broker module.
Run ActiveMQ broker from the command line
mvn clean package cargo:run
Populating the Database
Data population commands are run from the extensions/database module.
Delete database schema, then create and populate the database
mvn clean install -Preset-dbUpdate the database
mvn clean install -Pupdate-db
Updating Configuration Files
The following commands are run from the extensions/database module to update configuration files in your local ${user.home}/ep/conf directory. The configuration files are copied from the these locations in the extensions/database/ext-data module.
environments/default/files/confwhich contains default configuration files that apply to all environmentsenvironments/local/files/confwhich contains configuration files that apply only to the local development environmentDuplicate files present in the default environment are overwritten by those in the local environment.
Delete your local
${user.home}/ep/confdirectory and copy configuration files from the default and local environmentsmvn clean install -Preset-confCopy configuration files to your
${user.home}/ep/confdirectory from the default and local environments, overwriting existing filesmvn clean install -Pupdate-conf
Importing and Exporting Data Using the Import-Export Tool
For more information, see the Import-Export Tool Guide.
Import data from the target directory
mvn package -Pdo-importExport data to the target directory
mvn clean package -Pdo-export
Testing and Code Compliance
See Running Individual Tests for information about executing tests locally.