Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48541

Publishers plugins that are not installed shouldn't be called by Pipeline Maven

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline-maven-plugin
    • None
    • Jenkins 2.93, pipeline-maven 3.0.3

      Using withMaven shows all default publishers on Console Output even if the publisher plugin is not installed.

      I only have JUnit (junit) and Pipeline Maven Integration (pipeline-maven) installed but all  publishers are shown (run!?), creating lots of "noise" in the output.

      [relwithdebinfo] [withMaven]  Evaluate Maven Spy logs: /var/lib/jenkins/workspace/test-build@tmp/withMaven286b7780/maven-spy-20171213-145629-4818544732730429348117.log
      [relwithdebinfo] [withMaven] Maven Publishers with configuration provided by the pipeline: []
      [relwithdebinfo] [withMaven] Maven Publishers with configuration defined globally: []
      [relwithdebinfo] [withMaven] Maven Publishers with default configuration: [org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], org.jenkinsci.plugins.pipeline.maven.publishers.FindbugsAnalysisPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.JGivenTestsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.PipelineGraphPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}, skipDownstreamTriggers=false, lifecycleThreshold=deploy, ignoreUpstreamTriggers=false], org.jenkinsci.plugins.pipeline.maven.publishers.InvokerRunsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.ConcordionTestsPublisher[disabled=false]]
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Dependencies Fingerprint Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Findbugs Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Generated Artifacts Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'JGiven Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Pipeline Graph Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Invoker Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Junit Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Open Task Scanner Publisher'
      [relwithdebinfo] [withMaven] Use default defined publisher for 'Concordion Publisher'
      [relwithdebinfo] [withMaven] Run 'Generated Artifacts Publisher'...
      [relwithdebinfo] [withMaven] artifactsPublisher - ...
      ...
      [relwithdebinfo] [withMaven] artifactsPublisher - Archive and fingerprint artifacts {} located in workspace /var/lib/jenkins/workspace/test-build
      [relwithdebinfo] [withMaven] Run 'Invoker Publisher'...
      [relwithdebinfo] [withMaven] invokerPublisher - No org.apache.maven.plugins:maven-invoker-plugin:run execution found
      [relwithdebinfo] [withMaven] Run 'Junit Publisher'...
      [relwithdebinfo] [withMaven] junitPublisher - No org.apache.maven.plugins:maven-surefire-plugin:test execution found
      [relwithdebinfo] [withMaven] junitPublisher - No org.apache.maven.plugins:maven-failsafe-plugin:integration-test execution found
      [relwithdebinfo] [withMaven] Run 'Concordion Publisher'...
      [relwithdebinfo] [withMaven] concordionPublisher - No concordion output dir pattern given, skip.
      [relwithdebinfo] [withMaven] Run 'Dependencies Fingerprint Publisher'...
      [relwithdebinfo] [withMaven] dependenciesFingerprintPublisher - filter: versions[snapshot: true, release: false], scopes:[compile, provided, runtime]
      [relwithdebinfo] [withMaven] Skip fingerprinting release dependency: MavenDependency{...
      ...
      [relwithdebinfo] [withMaven] Run 'Findbugs Publisher'...
      [relwithdebinfo] [withMaven] Run 'JGiven Publisher'...
      [relwithdebinfo] [withMaven] jgivenPublisher - JGiven not found within your project dependencies, aborting.
      [relwithdebinfo] [withMaven] Run 'Pipeline Graph Publisher'...
      [relwithdebinfo] [withMaven] pipelineGraphPublisher - recordDependencies - filter: versions[snapshot: true, release: false], scopes:[compile, provided, runtime]
      ...
      [relwithdebinfo] [withMaven] pipelineGraphPublisher - recordGeneratedArtifacts...
      [relwithdebinfo] [withMaven] pipelineGraphPublisher - Record generated artifact: my_artifact:1.8, version: 1.8, executedLifecyclePhases: [clean, validate, generate-sources, process-sources, process-resources, compile, process-test-sources, process-test-resources, test-compile, test], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: /var/lib/jenkins/workspace/test-build/pom.xml
      [relwithdebinfo] [withMaven] pipelineGraphPublisher - Record generated artifact: my_artifact:1.8, version: 1.8, executedLifecyclePhases: [clean, validate, generate-sources, process-sources, process-resources, compile, process-test-sources, process-test-resources, test-compile, test], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: null
      [relwithdebinfo] [withMaven] Run 'Open Task Scanner Publisher'...
      [relwithdebinfo] [withMaven] Jenkins Task Scanner Plugin not found, don't display results of source code scanning for 'TODO' and 'FIXME' in pipeline screen.
      

          [JENKINS-48541] Publishers plugins that are not installed shouldn't be called by Pipeline Maven

          Nuno Costa added a comment -

          cleclerc
          Deleting or changing logger from org.jenkinsci.plugins.pipeline.maven to org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution cuts all the verbose in the console output but Task Scanner is not installed and is still seen:
          Using Log level All.

          [relwithdebinfo] [withMaven] artifactsPublisher - FAILURE to archive pom.xml under ... file not found in workspace /var/lib/jenkins/workspace/...
          [relwithdebinfo] [withMaven] FAILURE to fingerprint ... , file not found
          [relwithdebinfo] [withMaven] Jenkins Task Scanner Plugin not found, don't display results of source code scanning for 'TODO' and 'FIXME' in pipeline screen.
          

          Same output when using INFO log level.

          Using the withMaven pipeline options to manually disable the publishers (disabled: true) works correctly and skip the publishers but they are still shown.

          The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue.

          Nuno Costa added a comment - cleclerc Deleting or changing logger from org.jenkinsci.plugins.pipeline.maven to org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution cuts all the verbose in the console output but Task Scanner is not installed and is still seen: Using Log level All. [relwithdebinfo] [withMaven] artifactsPublisher - FAILURE to archive pom.xml under ... file not found in workspace / var /lib/jenkins/workspace/... [relwithdebinfo] [withMaven] FAILURE to fingerprint ... , file not found [relwithdebinfo] [withMaven] Jenkins Task Scanner Plugin not found, don 't display results of source code scanning for ' TODO ' and ' FIXME' in pipeline screen. Same output when using INFO log level. Using the withMaven pipeline options to manually disable the publishers (disabled: true) works correctly and skip the publishers but they are still shown. The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue.

          > The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue.

          Did you created a Jira issue?

          > but Task Scanner is not installed and is still seen

          Could you disable the TaskScannerPublisher in "Manage Master / Global Tool Configuration"?

          Cyrille Le Clerc added a comment - > The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue. Did you created a Jira issue? > but Task Scanner is not installed and is still seen Could you disable the TaskScannerPublisher in "Manage Master / Global Tool Configuration"?

          Nuno Costa added a comment -

          > The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue.

          Regarding artifactsPublisher, the issue was that we are using deleteDir() at the end of the pipeline, to avoid disk usage issues on buildserver. After removing deleteDir(), it successfully archived the artifact.

          The fingerprint part, I still can't figure out were the problem relies. I can see the file on .m2/repository/${EXECUTOR_NUMBER} path on the buildserver.
          It is even strange because the file is not a direct dependency mentioned in the main pom file nor the artifact itself. It seems to be a dependency of a dependency.

          > Could you disable the TaskScannerPublisher in "Manage Master / Global Tool Configuration"?

          If I disable using Global Tool Configuration, it still mentioned that is skipping the Task Scanner at the end of the build. Same behaviour as withMaven pipeline options.

          [relwithdebinfo] [withMaven] Skip 'Open Task Scanner Publisher' disabled by configuration
          

          Nuno Costa added a comment - > The failure on the artifactsPublisher and fingerprint seems to try to use a filename that is slightly different from the one that exists in the workplace but that is probably a different issue. Regarding artifactsPublisher , the issue was that we are using deleteDir() at the end of the pipeline, to avoid disk usage issues on buildserver. After removing deleteDir() , it successfully archived the artifact. The fingerprint part, I still can't figure out were the problem relies. I can see the file on .m2/repository/${EXECUTOR_NUMBER } path on the buildserver. It is even strange because the file is not a direct dependency mentioned in the main pom file nor the artifact itself. It seems to be a dependency of a dependency. > Could you disable the TaskScannerPublisher in "Manage Master / Global Tool Configuration"? If I disable using Global Tool Configuration , it still mentioned that is skipping the Task Scanner at the end of the build. Same behaviour as withMaven pipeline options. [relwithdebinfo] [withMaven] Skip 'Open Task Scanner Publisher' disabled by configuration

          ncosta thanks for deep diving in these problems.

          Cyrille Le Clerc added a comment - ncosta thanks for deep diving in these problems. artifactsPublisher --> good catch on the delete fingerprint --> I have never tested with a Maven repository located in " .m2/repository/${EXECUTOR_NUMBER }" Noisy log message: JENKINS-48657 and https://github.com/jenkinsci/pipeline-maven-plugin/pull/117

          ncosta can you test the fix for the noisy messages on pipeline-maven-3.2.0-alpha-2 ?

          https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.2.0-alpha-2
          https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/pipeline-maven/3.2.0-alpha-2/pipeline-maven-3.2.0-alpha-2.hpi

          ncosta can you open dedicated jira issues for the fingerprint and artifactPublisher if needed?
          The problem with artifact publisher may deserve a better error message, maybe an entry in the FAQ.
          I have not tried to reproduce the problem with fingerprints

          Cyrille Le Clerc added a comment - ncosta can you test the fix for the noisy messages on pipeline-maven-3.2.0-alpha-2 ? https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.2.0-alpha-2 https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/pipeline-maven/3.2.0-alpha-2/pipeline-maven-3.2.0-alpha-2.hpi ncosta can you open dedicated jira issues for the fingerprint and artifactPublisher if needed? The problem with artifact publisher may deserve a better error message, maybe an entry in the FAQ. I have not tried to reproduce the problem with fingerprints

          Nuno Costa added a comment -

          cleclerc,

          After install 3.2.0 alpha-2 and disabling task scanner, artifactsPublisher and dependencies fingerprint on Global Tool Config, no console output is seen (as expected). Kept logger org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution with log level ALL.

          Using logger org.jenkinsci.plugins.pipeline.maven with log level ALL, all publishers are seen on console output(global and default publishers), even when they are disabled on global config (shown as disabled by configuration). I assume this is intentional.

          Regarding artifact publisher, I can open an issue pointing to the "need" of not using deletedDir() at the end of the build.

          The fingerprint issue, I mentioned the Maven repository being located in .m2/repository/${EXECUTOR_NUMBER} but this is on BuildServer. Since is run inside a container, that folder is mounted on .m2/repository/ inside the container and this is the default location of artifacts repository. The specific file exists inside its respective folder on .m2/repository/

          I will try to replicate this fingerprint issue with the spring-petclinic project and open a separate issue.

          On a possible related issue that I mentioned on jenkins users group, findbugs and jgiven could also need some better error code or FAQ entries. Let me know if issues should be opened on pipeline-maven component or on the respective plugins.

          Nuno Costa added a comment - cleclerc , After install 3.2.0 alpha-2 and disabling task scanner, artifactsPublisher and dependencies fingerprint on Global Tool Config, no console output is seen (as expected). Kept logger org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution with log level ALL. Using logger  org.jenkinsci.plugins.pipeline.maven with log level ALL, all publishers are seen on console output(global and default publishers), even when they are disabled on global config (shown as disabled by configuration). I assume this is intentional. Regarding artifact publisher, I can open an issue pointing to the "need" of not using deletedDir() at the end of the build. The fingerprint issue, I mentioned the Maven repository being located in .m2/repository/${EXECUTOR_NUMBER } but this is on BuildServer. Since is run inside a container, that folder is mounted on .m2/repository/ inside the container and this is the default location of artifacts repository. The specific file exists inside its respective folder on .m2/repository/ I will try to replicate this fingerprint issue with the spring-petclinic project and open a separate issue. On a possible related issue that I mentioned on jenkins users group , findbugs and jgiven could also need some better error code or FAQ entries. Let me know if issues should be opened on pipeline-maven component or on the respective plugins.

          Nuno Costa added a comment -

          Hi cleclerc, just created JENKINS-48844 for fingerprint and JENKINS-48860 for artifactsPublisher, as you advised.

          Nuno Costa added a comment - Hi cleclerc , just created JENKINS-48844 for fingerprint and JENKINS-48860 for artifactsPublisher, as you advised.

          Thanks ncosta.

          > On a possible related issue that I mentioned on jenkins users group, findbugs and jgiven could also need some better error code or FAQ entries. Let me know if issues should be opened on pipeline-maven component or on the respective plugins.

          Please yes so that there is no misunderstanding, please track those as "Improvement" instead of "Bug"

          Cyrille Le Clerc added a comment - Thanks ncosta . > On a possible related issue that I mentioned on jenkins users group, findbugs and jgiven could also need some better error code or FAQ entries. Let me know if issues should be opened on pipeline-maven component or on the respective plugins. Please yes so that there is no misunderstanding, please track those as "Improvement" instead of "Bug"

          Nuno Costa added a comment -

          cleclerc

          Created 2 separate issues because I wasn't sure if this improvements will be made on pipeline-maven or on jgiven/findbugs side.

          JGiven: JENKINS-48935
          Findbugs: JENKINS-48937

          Nuno Costa added a comment - cleclerc Created 2 separate issues because I wasn't sure if this improvements will be made on pipeline-maven or on jgiven/findbugs side. JGiven: JENKINS-48935 Findbugs: JENKINS-48937

          3.2.0 is released

          Cyrille Le Clerc added a comment - 3.2.0 is released

            cleclerc Cyrille Le Clerc
            ncosta Nuno Costa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: