2017-12-06 13:03:06 +02:00
|
|
|
# mavenExecute
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
Executes a maven command inside a Docker container.
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2018-06-06 14:42:47 +02:00
|
|
|
| parameter | mandatory | default | example values |
|
|
|
|
| -------------------------------|-----------|-------------------|----------------------------|
|
2018-11-05 13:59:40 +02:00
|
|
|
| `script` | yes | | |
|
2018-06-06 14:42:47 +02:00
|
|
|
| `dockerImage` | no | 'maven:3.5-jdk-7' | |
|
|
|
|
| `globalSettingsFile` | no | | 'local_folder/settings.xml'|
|
|
|
|
| `projectSettingsFile` | no | | |
|
|
|
|
| `pomPath` | no | | 'local_folder/m2' |
|
|
|
|
| `flags` | no | | '-o' |
|
|
|
|
| `goals` | no | | 'clean install' |
|
|
|
|
| `m2Path` | no | | 'local_folder/m2' |
|
|
|
|
| `defines` | no | | '-Dmaven.tests.skip=true' |
|
|
|
|
| `logSuccessfulMavenTransfers` | no | `false` | 'true' |
|
2017-12-06 13:03:06 +02:00
|
|
|
|
2018-11-05 14:20:41 +02:00
|
|
|
* `script` defines the global script environment of the Jenkinsfile run.
|
2018-11-05 14:22:47 +02:00
|
|
|
Typically `this` is passed to this parameter. This allows the function
|
|
|
|
to access the commonPipelineEnvironment for retrieving, for example, configuration parameters..
|
2017-12-06 13:03:06 +02:00
|
|
|
* `dockerImage` Name of the docker image that should be used.
|
|
|
|
* `globalSettingsFile` Path or url to the mvn settings file that should be used as global settings file.
|
|
|
|
* `projectSettingsFile` Path or url to the mvn settings file that should be used as project settings file.
|
|
|
|
* `pomPath` Path to the pom file that should be used.
|
|
|
|
* `flags` Flags to provide when running mvn.
|
|
|
|
* `goals` Maven goals that should be executed.
|
|
|
|
* `m2Path` Path to the location of the local repository that should be used.
|
|
|
|
* `defines` Additional properties.
|
2018-06-06 14:42:47 +02:00
|
|
|
* `logSuccessfulMavenTransfers` configures maven to log successful downloads. This is set to `false` by default to reduce the noise in build logs.
|
2017-12-06 13:03:06 +02:00
|
|
|
|
2018-03-06 14:43:53 +02:00
|
|
|
## Step configuration
|
|
|
|
The following parameters can also be specified as step parameters using the global configuration file:
|
|
|
|
|
2017-12-06 13:03:06 +02:00
|
|
|
* `dockerImage`
|
|
|
|
* `globalSettingsFile`
|
|
|
|
* `projectSettingsFile`
|
|
|
|
* `pomPath`
|
|
|
|
* `m2Path`
|
|
|
|
|
|
|
|
## Exceptions
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```groovy
|
|
|
|
mavenExecute script: this, goals: 'clean install'
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|