buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject [10/11] buildr git commit: 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.
Date Sun, 22 May 2016 10:50:52 GMT
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 <peter@realityforge.org>
Authored: Sun May 22 20:44:54 2016 +1000
Committer: Peter Donald <peter@realityforge.org>
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


Mime
View raw message