Maven Configuration

Maven Build Node Configuration

Maven is used to compile and manage Java projects through the main stages of the application lifecycle, including build, deployment, and production delivery. Maven build-node settings can be managed through configuration files and stack-specific environment variables.

Maven Configuration Files

The Maven build node exposes the following main configuration directories:

FolderPathPurpose
PROJECTS/var/lib/jelastic/PROJECTSStores unpacked Maven project files.
conf/opt/maven/confContains Maven configuration files.
hooks/var/lib/jelastic/hooksStores scripts executed before or after build and deployment operations.
latest/usr/java/latestContains JDK libraries, tools, and binaries.
keys/var/lib/jelastic/keysStores private keys required by applications or node-to-node authentication.
vcs/var/lib/jelastic/vcsContains project property files with VCS configuration details.

PROJECTS Folder

The PROJECTS folder stores unpacked files for projects that were added, built, and deployed through the Maven node.

Maven PROJECTS folder
The PROJECTS folder stores unpacked Maven project files.

conf Folder

The conf directory contains the main Maven configuration files:

  • settings.xml — contains the primary Maven configuration.
  • toolchains.xml — defines which JDK or other tool should be used by embedded plugins during project builds.
  • variables.conf — stores custom variables and memory-related settings.
Maven conf folder
The conf folder contains settings.xml, toolchains.xml, and variables.conf.

hooks Folder

The hooks folder stores custom scripts that should run before or after application build and deployment operations.

Maven hooks folder
Store custom pre-build, post-build, pre-deploy, and post-deploy scripts in the hooks folder.

keys Folder

The keys directory is used for uploading private keys needed by an application. After uploading a key file, reference it with:

Key path

/var/lib/jelastic/keys/{key}

Maven keys folder
Upload private-key files to the keys directory.

latest Folder

The latest folder contains JDK libraries, tools, binaries, and related files. Existing files can be edited, and additional files can be uploaded when required.

Maven latest JDK folder
The latest folder contains the active JDK libraries, tools, and binaries.

vcs Folder

The vcs directory contains {project_name}.properties files with project configuration information. These files can be opened for inspection but are not editable.

Maven vcs folder
Inspect project properties in the read-only VCS configuration files.

Maven-Specific Variables

Click Additionally beside the Maven node and open the Variables section to review and adjust the stack variables.

Open Maven environment variables
Open the Variables section from the Maven node’s additional actions.
VariablePurpose
MAVEN_OPTSDefines essential Java server options such as -Xmx, -Xms, and -Xmn.
MAVEN_RUN_ARGSSets additional Maven command-line parameters for all projects, such as the number of process threads.
MAVEN_RUN_ARGS_{project}Sets additional parameters for one project. Replace spaces and dashes in the project name with underscores.
MAVEN_DEPLOY_ARTIFACTDefines the artifact that should be deployed for all projects.
MAVEN_DEPLOY_ARTIFACT_{project}Defines the artifact for one project and has higher priority than MAVEN_DEPLOY_ARTIFACT.
Maven build node variables
Review and adjust Maven-specific environment variables.

Expected Result

The Maven build node is configured through its exposed directories, files, hooks, keys, JDK resources, VCS metadata, and Maven-specific environment variables.

Important Notes

  • The VCS project property files are view-only.
  • Store private keys in /var/lib/jelastic/keys and protect access to them.
  • Project-specific variable names must use underscores instead of spaces and dashes.
  • Project-specific deploy-artifact variables override the global deploy-artifact variable.
  • Review Maven and deployment logs after changing build options.