From 455701d2ee6449abd8e5f640e718812d51c97fcd Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 10 Dec 2012 13:29:10 -0800 Subject: [PATCH] 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. --- .../springframework/build/gradle/merge/MergePlugin.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy b/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy index 961717503a..ffe4f87342 100644 --- a/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy +++ b/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy @@ -27,6 +27,7 @@ import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; import org.gradle.plugins.ide.idea.IdeaPlugin import org.gradle.api.invocation.* + /** * Gradle plugin that allows projects to merged together. Primarily developed to * allow Spring to support multiple multiple incompatible versions of third-party @@ -122,6 +123,11 @@ class MergePlugin implements Plugin { if(mapping.scope) { Configuration intoConfiguration = project.merge.into.configurations.add( project.name + "-" + configuration.name) + configuration.excludeRules.each { + configuration.exclude([ + (ExcludeRule.GROUP_KEY) : it.group, + (ExcludeRule.MODULE_KEY) : it.module]) + } intoConfiguration.dependencies.addAll(configuration.dependencies) project.merge.into.install.repositories.mavenInstaller.pom.scopeMappings.addMapping( mapping.priority + 100, intoConfiguration, mapping.scope)