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

Scope import / Maven BOM dependencies

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: pipeline-maven-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.112, Pipeline Maven Integration 3.5.0-beta1
    • Similar Issues:

      Description

      We use the following project to streamline dependencies across our modules: http://git.magnolia-cms.com/projects/BUILD/repos/boms/browse

      With the Maven plugin for freestyle jobs, building this repository would trigger downstream modules that import it in the following way: https://git.magnolia-cms.com/projects/PLATFORM/repos/ce.pub/browse/pom.xml#67

      I don't believe this has been implemented as I don't see that scope in the Dependencies Fingerprint Publisher. The Maven dashboard for that job lists no upstream nor downstream dependencies either.

      I'm not sure of the differences between this plugin vs. the one that works on freestyle jobs. Could this feature be implemented?

        Attachments

          Issue Links

            Activity

            Show
            cleclerc Cyrille Le Clerc added a comment - Scope "import" is missing here https://github.com/jenkinsci/pipeline-maven-plugin/blob/1729e64250c10213ca428141092540bdeeaba97a/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java#L67
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/pom.xml
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/src/main/java/com/example/demo1/Demo1Application.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/src/test/java/com/example/demo1/Demo1ApplicationTests.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/pom.xml
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/main/java/com/example/MonoModuleMavenApp.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppIT.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/pom.xml
            http://jenkins-ci.org/commit/pipeline-maven-plugin/c98d23be25d083debd107cd3caa7bde2ff7e1b1b
            Log:
            JENKINS-50475 Add support for scope "import"

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/pom.xml jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/src/main/java/com/example/demo1/Demo1Application.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/src/test/java/com/example/demo1/Demo1ApplicationTests.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/pom.xml jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/main/java/com/example/MonoModuleMavenApp.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppIT.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/pom.xml http://jenkins-ci.org/commit/pipeline-maven-plugin/c98d23be25d083debd107cd3caa7bde2ff7e1b1b Log: JENKINS-50475 Add support for scope "import"
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/pom.xml
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/pom.xml
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/main/java/com/example/MonoModuleMavenApp.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppIT.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/pom.xml
            http://jenkins-ci.org/commit/pipeline-maven-plugin/fa3c5b45e2b05747d737539c33f300a366184850
            Log:
            JENKINS-50475 Add support for scope "import"

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-bom/pom.xml jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/pom.xml jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/main/java/com/example/MonoModuleMavenApp.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppIT.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/my-jar/src/test/java/com/example/MonoModuleMavenAppTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_project_with_bom/pom.xml http://jenkins-ci.org/commit/pipeline-maven-plugin/fa3c5b45e2b05747d737539c33f300a366184850 Log: JENKINS-50475 Add support for scope "import"
            Hide
            cleclerc Cyrille Le Clerc added a comment - - edited

            FYI:

            • Scope import applies to the <dependencyManagement> section instead of the <dependencies> section. I don't know yet how to implement this.
            • I have updated a test case on this branch to progress.
            • IDea: track "bom dependencies" that are defined in the dependency-management section.
            • on pipeline-maven-plugin:3.5.0, the bom dependency is not tracked by the maven-event-spy https://gist.github.com/cyrille-leclerc/7423a631fb372a1a30571289c2f62365
            • Ideas are welcome.
            Show
            cleclerc Cyrille Le Clerc added a comment - - edited FYI: Scope import applies to the <dependencyManagement> section instead of the <dependencies> section. I don't know yet how to implement this. I have updated a test case on this branch to progress. IDea: track "bom dependencies" that are defined in the dependency-management section. on pipeline-maven-plugin:3.5.0, the bom dependency is not tracked by the maven-event-spy  https://gist.github.com/cyrille-leclerc/7423a631fb372a1a30571289c2f62365 Ideas are welcome.
            Hide
            cleclerc Cyrille Le Clerc added a comment - - edited

            Maxime Michel few questions to better understand please: the role of a Maven BOM is to define some dependencies that are pulled and to define the version of some other dependencies.

            The reason why you want to trigger downstream builds in case of changes of snapshot BOM is scenarios where you add/remove dependencies or change dependency version in the snapshot BOM, correct?

            If the BOM pulls a snapshot dependency and if the snapshot dependency gets redeployed, then withMaven would detect it and trigger the downstream job, correct?

             

            Note: I "stopped progress" as I don't know yet how to solve this problem.

             

            Show
            cleclerc Cyrille Le Clerc added a comment - - edited Maxime Michel  few questions to better understand please: the role of a Maven BOM is to define some dependencies that are pulled and to define the version of some other dependencies. The reason why you want to trigger downstream builds in case of changes of snapshot BOM is scenarios where you add/remove dependencies or change dependency version in the snapshot BOM, correct? If the BOM pulls a snapshot dependency and if the snapshot dependency gets redeployed, then withMaven would detect it and trigger the downstream job, correct?   Note: I "stopped progress" as I don't know yet how to solve this problem.  
            Hide
            mmichel Maxime Michel added a comment -

            Thanks for giving it a shot & sorry it took time to respond.

            The reason why you want to trigger downstream builds in case of changes of snapshot BOM is scenarios where you add/remove dependencies or change dependency version in the snapshot BOM, correct?

            Yes. If a BOM change doesn't trigger downstream builds, then a library version introducing problems might be merged and go unnoticed for some time. Making them harder to pinpoint when they're caught.

            If the BOM pulls a snapshot dependency and if the snapshot dependency gets redeployed, then withMaven would detect it and trigger the downstream job, correct?

            There are no SNAPSHOT dependencies in our BOM, they're all 3rd party dependencies (think commons-lang3 for instance). They don't appear as dependencies in any of our downstream jobs' Maven dashboards. Our feature request is that a SNAPSHOT BOM build should trigger another of our build that imports the BOM (with a scope `import`).

            We'll dedicate some time to try to take your branch further ASAP.

            Show
            mmichel Maxime Michel added a comment - Thanks for giving it a shot & sorry it took time to respond. The reason why you want to trigger downstream builds in case of changes of snapshot BOM is scenarios where you add/remove dependencies or change dependency version in the snapshot BOM, correct? Yes. If a BOM change doesn't trigger downstream builds, then a library version introducing problems might be merged and go unnoticed for some time. Making them harder to pinpoint when they're caught. If the BOM pulls a snapshot dependency and if the snapshot dependency gets redeployed, then withMaven would detect it and trigger the downstream job, correct? There are no SNAPSHOT dependencies in our BOM, they're all 3rd party dependencies (think commons-lang3 for instance). They don't appear as dependencies in any of our downstream jobs' Maven dashboards. Our feature request is that a SNAPSHOT BOM build should trigger another of our build that imports the BOM (with a scope `import`). We'll dedicate some time to try to take your branch further ASAP.

              People

              • Assignee:
                Unassigned
                Reporter:
                mmichel Maxime Michel
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: