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
master
Phillip Webb 12 years ago
parent 1065d82f08
commit bc80d25b49
  1. 2
      build.gradle
  2. 8
      buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy

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

@ -128,7 +128,13 @@ class MergePlugin implements Plugin<Project> {
(ExcludeRule.GROUP_KEY) : it.group,
(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(
mapping.priority + 100, intoConfiguration, mapping.scope)
}

Loading…
Cancel
Save