Restore compile dependencies in generated POMs

Ensure that merge projects do not downgrade the compile time
dependencies of the projects that they are merged into.

This commit restores the scope of the following dependencies which
were inadvertently changed between Spring 3.2.0 and 3.2.1:

    spring-orm
    -> spring-tx
    -> spring-jdbc

    spring-webmvc
    -> spring-context
    -> spring-web

    spring-test
    -> spring-webmvc

Issue: SPR-10218
This commit is contained in:
Phillip Webb 2013-01-25 16:38:30 -08:00
parent 1065d82f08
commit bc80d25b49
2 changed files with 8 additions and 2 deletions

View File

@ -689,7 +689,7 @@ project("spring-test-mvc") {
description = "Spring Test MVC Framework" description = "Spring Test MVC Framework"
merge.into = project(":spring-test") merge.into = project(":spring-test")
dependencies { dependencies {
provided(project(":spring-context")) optional(project(":spring-context"))
provided(project(":spring-webmvc")) provided(project(":spring-webmvc"))
provided("javax.servlet:javax.servlet-api:3.0.1") provided("javax.servlet:javax.servlet-api:3.0.1")
optional("org.hamcrest:hamcrest-core:1.3") optional("org.hamcrest:hamcrest-core:1.3")

View File

@ -128,7 +128,13 @@ class MergePlugin implements Plugin<Project> {
(ExcludeRule.GROUP_KEY) : it.group, (ExcludeRule.GROUP_KEY) : it.group,
(ExcludeRule.MODULE_KEY) : it.module]) (ExcludeRule.MODULE_KEY) : it.module])
} }
intoConfiguration.dependencies.addAll(configuration.dependencies) configuration.dependencies.each {
def intoCompile = project.merge.into.configurations.getByName("compile")
// Protect against changing a compile scope dependency (SPR-10218)
if(!intoCompile.dependencies.contains(it)) {
intoConfiguration.dependencies.add(it)
}
}
project.merge.into.install.repositories.mavenInstaller.pom.scopeMappings.addMapping( project.merge.into.install.repositories.mavenInstaller.pom.scopeMappings.addMapping(
mapping.priority + 100, intoConfiguration, mapping.scope) mapping.priority + 100, intoConfiguration, mapping.scope)
} }