Skip to content

Commit

Permalink
Restore compile dependencies in generated POMs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
philwebb committed Jan 26, 2013
1 parent 1065d82 commit bc80d25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bc80d25

Please sign in to comment.