Support bom-based dependency management in the CLI

Previously, the CLI’s dependency management used proprietary Properties
file-based metadata to configure its dependency management. Since
spring-boot-gradle-plugin’s move to using the separate dependency
management plugin the CLI was the only user of this format.

This commit updates the CLI to use Maven boms to configure its
dependency management. By default it uses the spring-boot-dependencies
bom. This configuration can be augmented and overridden using the new
@DependencyManagementBom annotation which replaces @GrabMetadata.

Closes gh-2688
Closes gh-2439
This commit is contained in:
Andy Wilkinson
2015-03-19 17:15:10 +00:00
parent 390e6fa690
commit 51c49b69c5
73 changed files with 1001 additions and 1624 deletions

View File

@@ -0,0 +1,5 @@
@DependencyManagementBom('test:child:1.0.0')
@Grab('ejb-api')
class CustomDependencyManagement {
}

View File

@@ -1,5 +0,0 @@
@org.springframework.boot.groovy.GrabMetadata('test:test:1.0.0')
@Grab('ejb-api')
class CustomGrabMetadata {
}

View File

@@ -0,0 +1,5 @@
@DependencyManagementBom("foo:bar:1.0")
@DependencyManagementBom("alpha:bravo:2.0")
class DuplicateDependencyManagement {
}

View File

@@ -1,5 +0,0 @@
@GrabMetadata("foo:bar:1.0")
@GrabMetadata("alpha:bravo:2.0")
class DuplicateGrabMetadata {
}

View File

@@ -0,0 +1,13 @@
<project>
<parent>
<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>child</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
</project>

View File

@@ -0,0 +1,18 @@
<project>
<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>