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

Downstream pipelines are not triggered when the artifact is a a WAR and consumed by war-overlay

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline-maven-plugin
    • None
    • Jenkins ver. 2.89.4, Slave on ubuntu, freshly updated plugins; Pipeline Maven Integration 3.4.2, maven 3.5.3

      Problem

      When a SNAPSHOT artifact is built (packaging = 'war'), its downstream project building a WAR-overlay depending on the upstream SNAPSHOT is not triggered.

      How to reproduce

      A test project (maven_war_overlay_project) with the described behaviour is available in the test_maven_projects directory on the fork in https://github.com/benzht/pipeline-maven-plugin/tree/JENKINS-50099 under the test_maven_projects (due to time constraints I could not integrate it into the test suite....).

      The new test project, maven_war_overlay_project, depends on the existing maven_war_project, which in turn depends on maven_jar_project.
      After manually building all of them, building the first correctly triggers the second, but maven_war_overlay_project is not triggered.
      Looking at the logging, it becomes clear that in the war_overlay_project no dependency is detected.

      Output from maven_war_project correctly records its dependency:

      ...
      [withMaven] pipelineGraphPublisher - recordParentProject - filter: versions[snapshot: true, release: false]
      [withMaven] pipelineGraphPublisher - recordDependencies - filter: versions[snapshot: true, release: false], scopes:[compile, provided, runtime]
      [withMaven] pipelineGraphPublisher - Record dependency: jenkins.mvn.test:mono-module-maven-app:0.1-SNAPSHOT, ignoreUpstreamTriggers: false
      [withMaven] pipelineGraphPublisher - Skip recording release dependency: javax.servlet:javax.servlet-api:3.1.0
      [withMaven] pipelineGraphPublisher - Skip recording release dependency: junit:junit:4.12
      [withMaven] pipelineGraphPublisher - Skip recording release dependency: org.hamcrest:hamcrest-core:1.3
      [withMaven] pipelineGraphPublisher - recordGeneratedArtifacts...
      [withMaven] pipelineGraphPublisher - Record generated artifact: jenkins.mvn.test:maven-war-app:0.1-SNAPSHOT, version: 0.1-SNAPSHOT, executedLifecyclePhases: [clean, process-resources, compile, process-test-resources, test-compile, test, package, install, deploy], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: /home/jenkins/slave/workspace/maven_war_project/pom.xml
      [withMaven] pipelineGraphPublisher - Record generated artifact: jenkins.mvn.test:maven-war-app:0.1-SNAPSHOT, version: 0.1-20180311.164646-4, executedLifecyclePhases: [clean, process-resources, compile, process-test-resources, test-compile, test, package, install, deploy], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: /home/jenkins/slave/workspace/maven_war_project/target/maven-war-app-0.1-SNAPSHOT.war
      ...
      

      Output from maven_war_overlay_project does not record any dependeny:

      ...
      [withMaven] pipelineGraphPublisher - recordParentProject - filter: versions[snapshot: true, release: false]
      [withMaven] pipelineGraphPublisher - recordDependencies - filter: versions[snapshot: true, release: false], scopes:[compile, provided, runtime]
      [withMaven] pipelineGraphPublisher - recordGeneratedArtifacts...
      [withMaven] pipelineGraphPublisher - Record generated artifact: jenkins.mvn.test:maven-war-overlay-app:0.1-SNAPSHOT, version: 0.1-SNAPSHOT, executedLifecyclePhases: [clean, process-resources, compile, process-test-resources, test-compile, test, package, install, deploy], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: /home/jenkins/slave/workspace/maven_war_overlay_project/pom.xml
      [withMaven] pipelineGraphPublisher - Record generated artifact: jenkins.mvn.test:maven-war-overlay-app:0.1-SNAPSHOT, version: 0.1-20180311.164534-3, executedLifecyclePhases: [clean, process-resources, compile, process-test-resources, test-compile, test, package, install, deploy], skipDownstreamTriggers: false, lifecycleThreshold:deploy, file: /home/jenkins/slave/workspace/maven_war_overlay_project/target/maven-war-overlay-app.war
      

      Jenkinsfile of maven_war_overlay_project:

      node {
         stage('Preparation') { // for display purposes
            git changelog: false, credentialsId: '3360632d-fb8d-4f68-be83-b650ec243e94', poll: false, url: 'http://........git'
         }
         stage('Build') {
              withMaven(jdk: 'JDK8', maven: 'M3',
                      globalMavenSettingsConfig: 'globalMavenSettings', options: [dependenciesFingerprintPublisher(), pipelineGraphPublisher(), artifactsPublisher(disabled: true)]) {
                  writeFile file: '.archive-jenkins-maven-event-spy-logs', text: ''
                  sh "mvn clean deploy"
              }
         }
      }
      

            Unassigned Unassigned
            benzht Hartmut Benz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: