Update the custom_pom addon to generate poms with exclusions section that 
excludes
all transitive dependencies. This is required as buildr dependencies are not
transitive while Maven's dependencies are transitive by default.


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/9c4d787a
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/9c4d787a
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/9c4d787a

Branch: refs/heads/master
Commit: 9c4d787a13b235b77a2f240d2129bc49571ceb9a
Parents: 588d83e
Author: Peter Donald <[email protected]>
Authored: Sun May 22 20:44:54 2016 +1000
Committer: Peter Donald <[email protected]>
Committed: Sun May 22 20:44:54 2016 +1000

----------------------------------------------------------------------
 CHANGELOG                     | 3 +++
 addon/buildr/custom_pom.rb    | 6 ++++++
 spec/addon/custom_pom_spec.rb | 2 ++
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/9c4d787a/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 0fee60c..4580fa2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,9 @@
 * Change: Update gwt addon to add the GWT artifacts to project dependencies as 
specs rather
           than files.
 * Change: Support the project.root_project utility method to retrieve the top 
level project.
+* Change: Update the custom_pom addon to generate poms with exclusions section 
that excludes
+          all transitive dependencies. This is required as buildr dependencies 
are not
+          transitive while Maven's dependencies are transitive by default.
 
 1.4.24 (2016-03-19)
 * Added:  Support the :no_invoke parameter being passed to Buildr.project() and

http://git-wip-us.apache.org/repos/asf/buildr/blob/9c4d787a/addon/buildr/custom_pom.rb
----------------------------------------------------------------------
diff --git a/addon/buildr/custom_pom.rb b/addon/buildr/custom_pom.rb
index 42e4e0b..b03ac9e 100644
--- a/addon/buildr/custom_pom.rb
+++ b/addon/buildr/custom_pom.rb
@@ -229,6 +229,12 @@ module Buildr
                 xml.version dependency[:version]
                 xml.scope dependency[:scope] unless dependency[:scope] == 
'compile'
                 xml.optional true if dependency[:optional]
+                xml.exclusions do
+                  xml.exclusion do
+                    xml.groupId '*'
+                    xml.artifactId '*'
+                  end
+                end
               end
             end
           end

http://git-wip-us.apache.org/repos/asf/buildr/blob/9c4d787a/spec/addon/custom_pom_spec.rb
----------------------------------------------------------------------
diff --git a/spec/addon/custom_pom_spec.rb b/spec/addon/custom_pom_spec.rb
index 088cd36..d44abe8 100644
--- a/spec/addon/custom_pom_spec.rb
+++ b/spec/addon/custom_pom_spec.rb
@@ -67,6 +67,8 @@ describe Buildr::CustomPom do
     verify_dependency_version(pom_xml, artifact_id, version)
     verify_dependency_scope(pom_xml, artifact_id, scope)
     verify_dependency_optional(pom_xml, artifact_id, optional)
+    pom_xml.should 
match_xpath("#{dependency_xpath(artifact_id)}/exclusions/exclusion/groupId", 
'*')
+    pom_xml.should 
match_xpath("#{dependency_xpath(artifact_id)}/exclusions/exclusion/artifactId", 
'*')
   end
 
   describe 'with explicitly specified pom details' do

Reply via email to