Continuous Integration
Last updated
Was this helpful?
Last updated
Was this helpful?
It is easy to integrate Maven with a CI project. Take advantage of profiles and Maven phases, and use a settings file for sensitive information.
The recommended steps are:
Running tests up to the verify phase
If that works deploy artifacts using Maven
Sensitive information, such authentication data for servers, should be stored inside a Maven settings file in a protected folder.
Three profiles are used when deploying artifacts:
A generic deployment profile
A development deployment profile
A releases deployment profile
These contain a small amount of configuration, which can be extended to add anything the project may need during deployment.
The generic generic deployment profile just disables the test:
Development deployment sets the development site deployment:
Release deployment sets the release site deployment:
The site URLs properties should be defined out of the POM, inside a Maven settings file, along the sites authentication data.
This will set up the credentials for deploying the artifacts, both the JAR/WAR and the Maven site, from environmental variables.
There is a for setting up a Maven settings file: