Skip to content

Commit 455701d

Browse files
rwinchphilwebb
authored andcommitted
Merge plugin copies exclude rules
Previously the 'merge from' project's configurations exclude rules were not used in the dynamically created 'merge into' project configurations. This meant that the pom generation for 'merge into' project did not exclude the dependencies from the 'merge from' project's configuration excludes. Now the exclude rules are copied into the dynamically created 'merge into' project's configurations.
1 parent 809d62e commit 455701d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import org.gradle.plugins.ide.eclipse.model.EclipseClasspath;
2727
import org.gradle.plugins.ide.idea.IdeaPlugin
2828
import org.gradle.api.invocation.*
2929

30+
3031
/**
3132
* Gradle plugin that allows projects to merged together. Primarily developed to
3233
* allow Spring to support multiple multiple incompatible versions of third-party
@@ -122,6 +123,11 @@ class MergePlugin implements Plugin<Project> {
122123
if(mapping.scope) {
123124
Configuration intoConfiguration = project.merge.into.configurations.add(
124125
project.name + "-" + configuration.name)
126+
configuration.excludeRules.each {
127+
configuration.exclude([
128+
(ExcludeRule.GROUP_KEY) : it.group,
129+
(ExcludeRule.MODULE_KEY) : it.module])
130+
}
125131
intoConfiguration.dependencies.addAll(configuration.dependencies)
126132
project.merge.into.install.repositories.mavenInstaller.pom.scopeMappings.addMapping(
127133
mapping.priority + 100, intoConfiguration, mapping.scope)

0 commit comments

Comments
 (0)