mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-05 15:15:44 +02:00
mavenExecute: generate docu
This commit is contained in:
parent
db6bf1ffa8
commit
3d0aa51380
@ -1,47 +1,10 @@
|
|||||||
# mavenExecute
|
# ${docGenStepName}
|
||||||
|
|
||||||
## Description
|
## ${docGenDescription}
|
||||||
|
|
||||||
Executes a maven command inside a Docker container.
|
## ${docGenParameters}
|
||||||
|
|
||||||
## Parameters
|
## ${docGenConfiguration}
|
||||||
|
|
||||||
| parameter | mandatory | default | example values |
|
|
||||||
| -------------------------------|-----------|-------------------|----------------------------|
|
|
||||||
| `script` | yes | | |
|
|
||||||
| `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' |
|
|
||||||
|
|
||||||
* `script` defines the global script environment of the Jenkinsfile run.
|
|
||||||
Typically `this` is passed to this parameter. This allows the function
|
|
||||||
to access the commonPipelineEnvironment for retrieving, for example,
|
|
||||||
configuration parameters.
|
|
||||||
* `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.
|
|
||||||
* `logSuccessfulMavenTransfers` configures maven to log successful downloads. This is set to `false` by default to reduce the noise in build logs.
|
|
||||||
|
|
||||||
## Step configuration
|
|
||||||
|
|
||||||
The following parameters can also be specified as step parameters using the global configuration file:
|
|
||||||
|
|
||||||
* `dockerImage`
|
|
||||||
* `globalSettingsFile`
|
|
||||||
* `projectSettingsFile`
|
|
||||||
* `pomPath`
|
|
||||||
* `m2Path`
|
|
||||||
|
|
||||||
## Exceptions
|
## Exceptions
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import static com.sap.piper.Prerequisites.checkScript
|
import static com.sap.piper.Prerequisites.checkScript
|
||||||
|
|
||||||
|
import com.sap.piper.GenerateDocumentation
|
||||||
import com.sap.piper.ConfigurationHelper
|
import com.sap.piper.ConfigurationHelper
|
||||||
import com.sap.piper.Utils
|
import com.sap.piper.Utils
|
||||||
|
|
||||||
@ -9,20 +10,37 @@ import groovy.transform.Field
|
|||||||
|
|
||||||
@Field Set GENERAL_CONFIG_KEYS = []
|
@Field Set GENERAL_CONFIG_KEYS = []
|
||||||
@Field Set STEP_CONFIG_KEYS = [
|
@Field Set STEP_CONFIG_KEYS = [
|
||||||
|
/** @see dockerExecute */
|
||||||
'dockerImage',
|
'dockerImage',
|
||||||
|
/** Path or url to the mvn settings file that should be used as global settings file.*/
|
||||||
'globalSettingsFile',
|
'globalSettingsFile',
|
||||||
|
/** Path or url to the mvn settings file that should be used as project settings file.*/
|
||||||
'projectSettingsFile',
|
'projectSettingsFile',
|
||||||
|
/** Path to the pom file that should be used.*/
|
||||||
'pomPath',
|
'pomPath',
|
||||||
|
/** Path to the location of the local repository that should be used.*/
|
||||||
'm2Path'
|
'm2Path'
|
||||||
]
|
]
|
||||||
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
|
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
|
||||||
|
/** @see dockerExecute */
|
||||||
'dockerOptions',
|
'dockerOptions',
|
||||||
|
/** Flags to provide when running mvn.*/
|
||||||
'flags',
|
'flags',
|
||||||
|
/** Maven goals that should be executed.*/
|
||||||
'goals',
|
'goals',
|
||||||
|
/** Additional properties.*/
|
||||||
'defines',
|
'defines',
|
||||||
|
/**
|
||||||
|
* Configures maven to log successful downloads. This is set to `false` by default to reduce the noise in build logs.
|
||||||
|
* @possibleValues `true`, `false`
|
||||||
|
*/
|
||||||
'logSuccessfulMavenTransfers'
|
'logSuccessfulMavenTransfers'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a maven command inside a Docker container.
|
||||||
|
*/
|
||||||
|
@GenerateDocumentation
|
||||||
void call(Map parameters = [:]) {
|
void call(Map parameters = [:]) {
|
||||||
handlePipelineStepErrors(stepName: STEP_NAME, stepParameters: parameters) {
|
handlePipelineStepErrors(stepName: STEP_NAME, stepParameters: parameters) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user