Automatic Dependency Management with Maven
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Example to configure Automatic Dependency Management with Maven
Solution
Plan A master or main plan have the following
pom.xml
:1 2 3 4 5 6
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.company.test</groupId> <artifactId>test-producer</artifactId> <version>1.1-SNAPSHOT</version> </project>
The version need to be SNAPSHOT
Plan B master or main plan have the following
pom.xml
:1 2 3 4 5 6 7 8 9 10 11 12 13
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.atlassian.test</groupId> <artifactId>test-consumer</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>com.company.test</groupId> <artifactId>test-producer</artifactId> <version>1.1-SNAPSHOT</version> </dependency> </dependencies> </project>
The version need to be SNAPSHOT
Add Maven Dependency Processor task to both plans
Enable the option Automatic Dependency Management at
Plan Configuration > Dependencies
in both plansRun builds in both master or main plans
Was this helpful?