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

Pipeline maven integration job not triggered when using Maven multi-module parent

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline-maven-plugin
    • None
    • Linux RHEL 7 3.10.0-514.el7.x86_64
      Jenkins 2.89.2
      Pipeline-maven-plugin 3.5.2
      Pipeline-plugin 2.5
      Maven 3.5.2
      Java 1.8.0_112-b15 (x86_64)

      Given a project foo based on a maven multi-module approach with a groupid/artifactid/version (GAV) : foo:par:1.0.0-SNAPSHOT and ** with (at least) one submodule : 

      • foo:elem1:1.0.0-SNAPSHOT

      And a project bar based also on a maven multi-module approach with a GAV : bar:par:1.0.0-SNAPSHOT and ** with (at least) one submodule : 

      • bar:elem1:1.0.0-SNAPSHOT that depends on foo:elem1:1.0.0-SNAPSHOT

      Two Multibranch pipeline jobs based on each of this projects based one the same Jenkinsfile with such step :

       

      withMaven(maven: 'maven-3.5.2', options: [pipelineGraphPublisher(includeReleaseVersions: true)]) {
        sh "mvn clean deploy"
      }
      
      

       

      If we're triggering a run job for project foo it won't trigger the build of bar project 

      Additionally:

      In the bar project the Maven "Downstream Jobs" section is empty 

      In the bar project the Maven "Upstream Builds" section is empty 

       

      Thanks a lot for your help or any insight !

          [JENKINS-50782] Pipeline maven integration job not triggered when using Maven multi-module parent

          Can you please tell us if "foo:elem1:1.0.0-SNAPSHOT" appears in

          • the list of generated artifacts of the upstream pipeline "foo"
          • the list of dependencies of the downstream pipeline "bar"

           

          Cyrille Le Clerc added a comment - Can you please tell us if "foo:elem1:1.0.0-SNAPSHOT" appears in the list of generated artifacts of the upstream pipeline "foo" the list of dependencies of the downstream pipeline "bar"  

          Hello,

          foo:elem1:1.0.0-SNAPSHOT appears only in the generated artifacts of the foo pipeline.

          Rémy Coqueugniot added a comment - Hello, foo:elem1:1.0.0-SNAPSHOT appears only in the generated artifacts of the foo pipeline.

          xflash can you please attach the withMaven report of the downstream pipeline as described in https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-HowdoIcapturethelogfilegeneratedbytheJenkinsMavenEventSpy ?

          Don't forget sanitizing the file if needed.

          Cyrille Le Clerc added a comment - xflash can you please attach the withMaven report of the downstream pipeline as described in https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-HowdoIcapturethelogfilegeneratedbytheJenkinsMavenEventSpy  ? Don't forget sanitizing the file if needed.

          Hello Cyrille,

          Please find attached to this issue, a freshly generated maven-spy-log file corresponding to a the "foo" project.

           

          Thanks for your help

           

          Rémy Coqueugniot added a comment - Hello Cyrille, Please find attached to this issue, a freshly generated maven-spy-log file corresponding to a the "foo" project.   Thanks for your help  

          The cause may be that withMaven doesn't record generated artifacts if they are also dependencies consumed by the same Maven build. This trick was introduced to prevent infinite loops on multi-branch pipelines.
          Maybe you are hitting a case were an intermediate of your upstream project is also a dependency of other pipelines.

          Could this be the case?

          Note: JENKINS-51680 could fix such "edge case".

          https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.5.8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java#L156

          Cyrille Le Clerc added a comment - The cause may be that withMaven doesn't record generated artifacts if they are also dependencies consumed by the same Maven build. This trick was introduced to prevent infinite loops on multi-branch pipelines. Maybe you are hitting a case were an intermediate of your upstream project is also a dependency of other pipelines. Could this be the case? Note: JENKINS-51680 could fix such "edge case". https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.5.8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java#L156

            Unassigned Unassigned
            xflash Rémy Coqueugniot
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: