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

PipelineGraphPublisher should also declare artifacts' parents as dependency

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Since JENKINS-44721, pipeline jobs have the ability to be triggered by other pipeline jobs when one of their SNAPSHOT dependencies changes. While this works well already, there is a use case which was supported in the old Maven project type which is not supported any more, and that is the triggering when the parent of an artifact changes. An example scenario would be as follows:

      Jenkins project A builds Maven modules a0, a1, a2, and so on. a0 is the parent POM of all a* modules.

      Jenkins project B builds Maven modules b0, b1, b2, and so on. b0 is the parent POM of all b* modules. b0 uses a2 as its parent POM.

      In the old Maven project, a dependency between A and B would have been established because of the parent dependency between b0 and a2. With the pipeline-maven-plugin, this is currently not the case, so a build of A does not trigger a new build of B.

      This behavior could probably be recreated by reading the parent artifact from the POM and declaring it as additional dependency.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            Jenkinsfile
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginDao.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginH2Dao.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginNullDao.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/DependenciesLister.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java
            jenkins-plugin/src/main/resources/sql/h2/05_migration.sql
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/AbstractIntegrationTest.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/DependencyGraphTest.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginH2DaoTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/.gitignore
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/pom.xml
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/src/main/java/com/example/MonoModuleMavenApp.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/src/test/java/com/example/MonoModuleMavenAppTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_pom_project/pom.xml
            maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/handler/ProjectStartedExecutionHandler.java
            http://jenkins-ci.org/commit/pipeline-maven-plugin/5aba93f4188b0f5e05ef24eb17fb9ab4643d5baf
            Log:
            JENKINS-46368 Trigger downstream pipeline on Maven parent pom changes

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: Jenkinsfile jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginDao.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginH2Dao.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginNullDao.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/DependenciesLister.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java jenkins-plugin/src/main/resources/sql/h2/05_migration.sql jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/AbstractIntegrationTest.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/DependencyGraphTest.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/dao/PipelineMavenPluginH2DaoTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/.gitignore jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/pom.xml jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/src/main/java/com/example/MonoModuleMavenApp.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_jar_with_parent_pom_project/src/test/java/com/example/MonoModuleMavenAppTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_pom_project/pom.xml maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/handler/ProjectStartedExecutionHandler.java http://jenkins-ci.org/commit/pipeline-maven-plugin/5aba93f4188b0f5e05ef24eb17fb9ab4643d5baf Log: JENKINS-46368 Trigger downstream pipeline on Maven parent pom changes
            Show
            cleclerc Cyrille Le Clerc added a comment - Markus Dlugi , Bertrand Renuart , benoit guerin can you please test https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/pipeline-maven/3.1.0-beta-1/pipeline-maven-3.1.0-beta-1.hpi
            Hide
            falcon benoit guerin added a comment -

            It is now in our production Jenkins

            Show
            falcon benoit guerin added a comment - It is now in our production Jenkins
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            Shipped in 3.1.0

            Show
            cleclerc Cyrille Le Clerc added a comment - Shipped in 3.1.0
            Hide
            cleclerc Cyrille Le Clerc added a comment - - edited

            Markus Dlugi, Bertrand Renuart, benoit guerin 3.5.7-beta-1 is an optimisation of the SQL queries to find dependencies. Would you mind testing it on your environments to verify that there is no regression?

            Please don't hesitate to backup your H2 db before the test. (${jenkins_home}/jenkins-jobs/jenkins-jobs.mv.db)

            https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.5.7-beta-1

            Show
            cleclerc Cyrille Le Clerc added a comment - - edited Markus Dlugi , Bertrand Renuart , benoit guerin 3.5.7-beta-1 is an optimisation of the SQL queries to find dependencies. Would you mind testing it on your environments to verify that there is no regression? Please don't hesitate to backup your H2 db before the test. (${jenkins_home}/jenkins-jobs/jenkins-jobs.mv.db) https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.5.7-beta-1

              People

              Assignee:
              cleclerc Cyrille Le Clerc
              Reporter:
              markusdlugi Markus Dlugi
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: