Use spring-boot-dependencies as spring-boot-dependency-tools' parent

Previously spring-boot-dependency-tools used spring-boot-tools as its
parent. This meant that it inherited spring-boot-parents' dependency
management that we did not want to expose to applications. The
solution to this was to generate the effective pom and then filter
out any thing that did not appear in spring-boot-dependencies' pom.
This filtering had to unwanted side-effect of breaking bom imports:
the effective pom would contain the dependency management from the
imported bom, but this would be filtered out as the entries didn't
appear in spring-boot-dependencies' pom.

This commit updates spring-boot-dependency-tools to use
spring-boot-dependencies as its parent. This means that its effective
pom contains the desired dependency management and nothing more,
allowing the filtering logic to be removed.

The use of Spring Security's bom has been reinstated as it will now
work as intended and versions for its modules will be available in the
CLI and via the Gradle plugin.

Closes #825
Fixes #838
This commit is contained in:
Andy Wilkinson
2014-05-20 14:33:19 +01:00
parent b94e8f54f6
commit 307fbba9e4
8 changed files with 28 additions and 135 deletions

View File

@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat;
/**
* Tests for {@link PomManagedDependencies}.
*
*
* @author Phillip Webb
*/
public class PomManagedDependenciesTests {
@@ -39,8 +39,7 @@ public class PomManagedDependenciesTests {
@Before
public void setup() {
InputStream x = getResource("test-effective-pom.xml");
InputStream y = getResource("test-dependencies-pom.xml");
this.dependencies = new PomManagedDependencies(x, y);
this.dependencies = new PomManagedDependencies(x);
}
private InputStream getResource(String name) {
@@ -76,11 +75,6 @@ public class PomManagedDependenciesTests {
assertThat(this.dependencies.find("org.sample", "missing"), nullValue());
}
@Test
public void findByArtifactAndGroupIdOnlyInEffectivePom() throws Exception {
assertThat(this.dependencies.find("org.extra", "extra01"), nullValue());
}
@Test
public void findByArtifactId() throws Exception {
assertThat(this.dependencies.find("sample02").toString(),

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<version>1.0.0.BUILD-SNAPSHOT</version>
<properties>
<sample.version>1.0.0</sample.version>
</properties>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.sample</groupId>
<artifactId>sample01</artifactId>
<version>${sample.version}</version>
<exclusions>
<exclusion>
<groupId>org.exclude</groupId>
<artifactId>exclude01</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.sample</groupId>
<artifactId>sample02</artifactId>
<version>${sample.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@@ -29,11 +29,6 @@
<artifactId>spring-boot</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.extra</groupId>
<artifactId>extra01</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>