MavenΒΆ
In case you want to build a Java project, we provide a Docker image for a Java Maven build.
To use this image in a .gitlab-ci.yml file, you can specify a build stage to build a JAR file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
In the script
section you can execute any Maven build step. The -s ci_settings.xml
option is a proper way to
pass a suitable settings file, which is committed in VCS.
The variable MAVEN_OPTS
should also be set. Here you can specify the local repository the Maven build
process should use. This directory is also cached, so we avoid to downloading the third party modules
when not necessary.
The created artifact is stored in Gitlab and can be used for deployment.