Maven Build Node Configuration
Maven is a project management and compilation tool for Java. All the primary phases of your Java application lifecycle, from building and deploying to pushing to production, are handled out-of-the-box at PaaS.
All Maven server settings can be changed using:
Maven Configuration Files
The following server directories include the major Maven build node configuration files:
Folder | Path |
---|---|
PROJECTS | /var/lib/jelastic/PROJECTS |
conf | /opt/maven/conf |
hooks | /var/lib/jelastic/hooks |
latest | /usr/java/latest |
keys | /var/lib/jelastic/keys |
vcs | /var/lib/jelastic/vcs |
PROJECTS
Files for projects added, built, and deployed with the Maven node are kept in the PROJECTS folder.
Conf
The conf directory includes these files:
- settings.xml: holds the main Maven configurations.
- toolchains.xml: specifies which JDK (or other tools) should be used by embedded plugins during the project build.
- variables.conf: allows you to set custom variables and configure memory settings.
Hooks
Custom scripts, sometimes referred to as “hooks,” are included in the hooks folder and must be run either before or after application build and deploy procedures.
Keys
The keys directory is where you store private keys that your application needs to be uploaded.
To generate your key, all you need to do is save it as a regular file and upload it to the keys folder. After that, you can use it for different things (like node-to-node authentication) by giving the correct path in /var/lib/jelastic/keys/{key}.
Latest
All JDK binaries, tools, libraries, and so on are contained in the most recent folder. If necessary, you can upload new files or edit the ones that already exist.
VCS
You have a list of {project_name}.properties files in the vcs directory that hold all the details of your projects. Although you cannot modify these configuration files, you can view them to examine project-specific parameters.
Maven-Specific Variables
In addition, certain environment variables that are incorporated especially for this stack template can be used to control the Maven build node:
1. Click on the “Additionally” button next to your Maven node and go to the “Variables” section.
2. In the opened window, you’ll find a list of default variables for the stack, which you can customize according to your requirements.
Here are the Maven-specific variables:
- MAVEN_OPTS: This allows you to set values for important Java server options like -Xmx, -Xms, -Xmn, etc.
- MAVEN_RUN_ARGS: It specifies additional Maven command-line parameters that should be applied to all Maven projects. For instance, it can be used to define the number of process threads.
- MAVEN_RUN_ARGS_{project}: This sets additional parameters for a specific project. Note that the project name should be written with underscores instead of spaces or dashes.
- MAVEN_DEPLOY_ARTIFACT: It determines the artifact to be deployed for all projects.
- MAVEN_DEPLOY_ARTIFACT_{project}: This provides an artifact for a particular project. It takes precedence over MAVEN_DEPLOY_ARTIFACT.
You can fully customize the Maven build node to meet the unique needs of your Java project by using these variables to take complete control over it.