The defaultResultsStage
analyses the produced artifacts generated by maven.
At the moment the following reports are supported:
- JUnit test reports (via JUnit Plugin and via Warnings Next Generation Plugin)
- JaCoCo code coverage (via Jacoco Plugin)
- findbugs (via Warnings Next Generation Plugin)
- pmd (via Warnings Next Generation Plugin)
- checkstyle (via Warnings Next Generation Plugin)
The step also scans for open tasks via Warnings Next Generation Plugin.
- Extension options
- Configuration options
_extend
(optional)enabled
(optional)checkstyle
(optional)fingerprint
(optional)findbugs
(optional)jacoco
(optional)enabled
(optional)buildOverBuild
(optional)changeBuildStatus
(optional)classPattern
(optional)deltaBranchCoverage
(optional)deltaClassCoverage
(optional)deltaComplexityCoverage
(optional)deltaInstructionCoverage
(optional)deltaLineCoverage
(optional)deltaMethodCoverage
(optional)exclusionPattern
(optional)execPattern
(optional)inclusionPattern
(optional)maximumBranchCoverage
(optional)maximumClassCoverage
(optional)maximumComplexityCoverage
(optional)maximumInstructionCoverage
(optional)maximumLineCoverage
(optional)maximumMethodCoverage
(optional)minimumBranchCoverage
(optional)minimumClassCoverage
(optional)minimumComplexityCoverage
(optional)minimumInstructionCoverage
(optional)minimumLineCoverage
(optional)minimumMethodCoverage
(optional)skipCopyOfSrcFiles
(optional)sourcePattern
(optional)
junit
(optional)openTasks
(optional)pmd
(optional)
This step supports the extension mechanism, so you are able to extend the step by executing code before and/or after the step is executed or even replacing the whole functionality.
💡 See _extend
for an example.
All configuration options must be inside the stageResults
(ConfigConstants.STAGE_RESULTS
)
map element to be evaluated and used by the step.
import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*
defaultPreparationStage(
(STAGE_RESULTS) : [
(STAGE_RESULTS_ENABLED) : true,
(STAGE_RESULTS_EXTEND) : null,
(STAGE_RESULTS_CHECKSTYLE) : [
(STAGE_RESULTS_CHECKSTYLE_ENABLED) : true
],
(STAGE_RESULTS_FINGERPRINT) : [
(STAGE_RESULTS_FINGERPRINT_ENABLED) : true,
(STAGE_RESULTS_FINGERPRINT_FILESET) : "**/target/**/*.zip,**/target/**/*.jar",
],
(STAGE_RESULTS_JACOCO) : [
(STAGE_RESULTS_JACOCO_ENABLED) : true,
(STAGE_RESULTS_JACOCO_BUILD_OVER_BUILD): false,
(STAGE_RESULTS_JACOCO_CHANGE_BUILD_STATUS): false,
(STAGE_RESULTS_JACOCO_CLASS_PATTERN): '**/target/classes',
(STAGE_RESULTS_JACOCO_DELTA_BRANCH_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_DELTA_CLASS_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_DELTA_COMPLEXITY_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_DELTA_INSTRUCTION_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_DELTA_LINE_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_DELTA_METHOD_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_EXEC_PATTERN): '**/target/**.exec',
(STAGE_RESULTS_JACOCO_EXCLUSION_PATTERN): "",
(STAGE_RESULTS_JACOCO_INCLUSION_PATTERN): "",
(STAGE_RESULTS_JACOCO_MAXIMUM_BRANCH_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MAXIMUM_CLASS_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MAXIMUM_COMPLEXITY_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MAXIMUM_INSTRUCTION_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MAXIMUM_LINE_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MAXIMUM_METHOD_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_BRANCH_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_CLASS_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_COMPLEXITY_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_INSTRUCTION_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_LINE_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_MINIMUM_METHOD_COVERAGE): "0",
(STAGE_RESULTS_JACOCO_SKIP_COPY_OF_SRC_FILES):false,
(STAGE_RESULTS_JACOCO_SOURCE_PATTERN): "**/src/main/java",
],
(STAGE_RESULTS_JUNIT) : [
(STAGE_RESULTS_JUNIT_ENABLED) : true
],
(STAGE_RESULTS_FINDBUGS) : [
(STAGE_RESULTS_FINDBUGS_ENABLED) : true
],
(STAGE_RESULTS_OPEN_TASKS) : [
(STAGE_RESULTS_OPEN_TASKS_ENABLED) : true
],
(STAGE_RESULTS_PMD) : [
(STAGE_RESULTS_PMD_ENABLED) : true
],
]
)
Constant | ConfigConstants.STAGE_RESULTS_EXTEND |
Type | Closure with signature (Map config, superImpl) |
Default | null |
Use this configuration option to overwrite or extend the
defaultResultsStage
step.
Example:
import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*
import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
def customResultsStage(Map config, superImpl) {
echo "before defaultResultsStage stage"
superImpl(config)
echo "after defaultResultsStage stage"
}
defaultResultsStage(
(STAGE_RESULTS) : [
(STAGE_RESULTS_EXTEND) : this.&customResultsStage
]
)
Constant | ConfigConstants.STAGE_RESULTS_ENABLED |
Type | Boolean |
Default | true |
Use this configuration option to enable (default) or disable the
defaultResultsStage
step.
Constant | ConfigConstants.STAGE_RESULTS_CHECKSTYLE |
Type | Map |
Configures the checkStyle tool of the Warnings Next Generation.
Constant | ConfigConstants.STAGE_RESULTS_CHECKSTYLE_ENABLED |
Type | Boolean |
Enables/disables the checkStyle tool of the Warnings Next Generation.
Constant | ConfigConstants.STAGE_RESULTS_CHECKSTYLE_REPORT_ENCODING |
Type | String |
Configure the reportEncoding for the checkStyle tool of the Warnings Next Generation.
Constant | ConfigConstants.STAGE_RESULTS_CHECKSTYLE_PATTERN |
Type | String |
Default | **/target/checkstyle-result*.xml |
Configure the pattern for the checkStyle tool of the Warnings Next Generation.
Constant | ConfigConstants.STAGE_RESULTS_FINDBUGS |
Type | Map |
Configures findBugs tool for Warnings Next Generation.
Constant | ConfigConstants.STAGE_RESULTS_FINDBUGS_ENABLED |
Type | Boolean |
Default | true |
Enables/disables findBugs tool for Warnings Next Generation Plugin.
Constant | ConfigConstants.STAGE_RESULTS_FINGERPRINT |
Type | Map |
Configures the fingerprinting of artifacts.
Constant | ConfigConstants.STAGE_RESULTS_FINGERPRINT_ENABLED |
Type | Boolean |
Default | true |
Enables/disables the fingerprinting of artifacts.
Constant | ConfigConstants.STAGE_RESULTS_FINGERPRINT_FILESET |
Type | String |
Default | **/target/**/*.zip,**/target/**/*.jar |
Configures the ANT fileset for the artifacts that should be fingerprinted.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO |
Type | Map |
Configures the JaCoCo Plugin.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_ENABLED |
Type | Boolean |
Default | true |
Enables/disables JaCoCo Plugin.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_BUILD_OVER_BUILD |
Type | Boolean |
Default | false |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_CHANGE_BUILD_STATUS |
Type | Boolean |
Default | false |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_CLASS_PATTERN |
Type | String |
Default | **/target/classes |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_BRANCH_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_CLASS_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_COMPLEXITY_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_INSTRUCTION_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_LINE_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_DELTA_METHOD_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_EXCLUSION_PATTERN |
Type | String |
Default | "" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_EXEC_PATTERN |
Type | String |
Default | **/target/**.exec |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_INCLUSION_PATTERN |
Type | String |
Default | "" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_BRANCH_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_CLASS_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_COMPLEXITY_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_INSTRUCTION_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_LINE_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MAXIMUM_METHOD_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_BRANCH_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_CLASS_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_COMPLEXITY_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_INSTRUCTION_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_LINE_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_MINIMUM_METHOD_COVERAGE |
Type | String |
Default | "0" |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_SKIP_COPY_OF_SRC_FILES |
Type | Boolean |
Default | false |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JACOCO_SOURCE_PATTERN |
Type | String |
Default | **/src/main/java |
Please refer to the JaCoCo Plugin documentation for more details.
Constant | ConfigConstants.STAGE_RESULTS_JUNIT |
Type | Map |
Configures the JUnit Plugin.
Constant | ConfigConstants.STAGE_RESULTS_JUNIT_ENABLED |
Type | Boolean |
Default | true |
Enables/disables JUnit Plugin and the junitPublisher tool for Warnings Next Generation Plugin.
Constant | ConfigConstants.STAGE_RESULTS_OPEN_TASKS |
Type | Map |
Configures the taskScanner tool for Warnings Next Generation Plugin.
Constant | ConfigConstants.STAGE_RESULTS_OPEN_TASKS_ENABLED |
Type | Boolean |
Default | true |
Enables/disables the taskScanner tool for Warnings Next Generation Plugin.
Constant | ConfigConstants.STAGE_RESULTS_PMD |
Type | Map |
Configures the pmd tool for Warnings Next Generation Plugin.
Constant | ConfigConstants.STAGE_RESULTS_PMD_ENABLED |
Type | Boolean |
Default | true |
Enables/disables the pmd tool for Warnings Next Generation Plugin.