Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-21137

Consider parent as a dependency in automatic maven deps management

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Maven
    • None
    • 0
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Issue Summary

      Currently, Bamboo only parses <dependencies></dependencies> when automatic dependency management is enabled for a plan, and it indeed works as expected - builds of parent Maven projects trigger builds of child project.

      However, Bamboo does not take into consideration <parent></parent>, and since it's not considered as a dependency, child plans cannot be built automatically when a parent is built.

      Steps to Reproduce

      1. Create a plan with a repo that has one pom.xml. It will be parent
      <project>
          <modelVersion>4.0.0</modelVersion>
          <groupId>com.atlassian</groupId>
          <artifactId>test</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <packaging>pom</packaging>
          <name>Example Parent</name>
          <url>http://maven.apache.org</url>
          <properties>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
              <junit.version>4.13.1</junit.version>
              <spring.version>1.2.8</spring.version>
          </properties>
      </project>
      
      1. Create a plan that has a repo with the child pom. xml that uses the above parent:
      <project>
          <modelVersion>4.0.0</modelVersion>
          <parent>
              <groupId>com.atlassian</groupId>
              <artifactId>test</artifactId>
              <version>0.0.1-SNAPSHOT</version>
          </parent>
          <artifactId>test-plugin1</artifactId>
          <name>Test Plugin Using Parent</name>
          <packaging>jar</packaging>
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>${junit.version}</version>
                  <scope>test</scope>
              </dependency>
          </dependencies>
      </project>
      

      3. Add Maven dependency analyzer task for both. Enable automatic dependency management for both.

      Expected Results

      When plan1 is built, it should trigger build of plan2.

      Actual Results

      Plan2 build is not triggered when plan1 is successfully built.

      Workaround

      Explicitly add dependency on parent in <dependencies></dependencies>:

      <dependency>
          <groupId>com.atlassian</groupId>
          <artifactId>test</artifactId>
          <version>0.0.1-SNAPSHOT</version>
       <type>pom</type>
      </dependency>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            c64f33b2bce3 Yevhen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: