-
Improvement
-
Resolution: Fixed
-
Minor
-
None
Currently when you upgrade the plugin you are at risk that new reporters are added/integrated and these collide with existing pipeline code you have to parse these results.
This leads to duplicate reports.
On top of this you may want to get the version of the thing you are building by useing something like
withMaven() { bsVersion = returnStdout: true, script: sh "mvn help:evaluate -Dexpression=project.version | grep -E '^[[:digit:]+.]+.*-SNAPSHOT' " }
unfortunately using the above means that the taskScanner is currently invoked (which will then be invoked multiple times) which will cause unnecessary IO, fingerprinting is also involved - which again when you just want to run a simple maven command with no scanners is not good. The workaround of adding
withMaven(options: [concordionPublisher(disabled: true), findbugsPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true), artifactsPublisher(disabled: true), invokerPublisher(disabled: true), junitPublisher(disabled: true, ignoreAttachments: false), openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]) { // some block }
is both verbose and will likely not do what is expected when a new publisher/reporter is integrated.
- is duplicated by
-
JENKINS-47667 "Option" to disable every publishers/reporters
-
- Closed
-
-
JENKINS-49708 withMaven option to skip ALL reporters
-
- Closed
-
- relates to
-
JENKINS-45887 Automatically archive JGiven reports
-
- Closed
-
Code changed in jenkins
User: Cyrille Le Clerc
Path:
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenPublisher.java
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenPublisherStrategy.java
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenSpyLogProcessor.java
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStep.java
jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
jenkins-plugin/src/main/resources/org/jenkinsci/plugins/pipeline/maven/WithMavenStep/config.jelly
jenkins-plugin/src/main/resources/org/jenkinsci/plugins/pipeline/maven/WithMavenStep/help-publisherStrategy.html
http://jenkins-ci.org/commit/pipeline-maven-plugin/a353d078089aca62f5ddc9ea75ab633655cfe85a
Log:
JENKINS-46785Strategy to enable / disable publishers in pipelines.Default strategy, "IMPLICIT" is the current strategy to implicitly enable all publishers unless they are explicitly disabled. The second available strategy, "EXPLICIT", requires to explicitly enable the publishers in the "withMaven(options: [...])" attribute