small improvement for POM creation.
Project: http://git-wip-us.apache.org/repos/asf/ode/repo Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/d78d216e Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/d78d216e Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/d78d216e Branch: refs/heads/ode-1.3.x Commit: d78d216e75405408bea5a686492cf32099e62bef Parents: 31d2afb Author: Tammo van Lessen <[email protected]> Authored: Thu Jun 11 16:22:37 2015 +0200 Committer: Tammo van Lessen <[email protected]> Committed: Thu Jun 11 23:03:39 2015 +0200 ---------------------------------------------------------------------- tasks/pomwithdependencies.rake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ode/blob/d78d216e/tasks/pomwithdependencies.rake ---------------------------------------------------------------------- diff --git a/tasks/pomwithdependencies.rake b/tasks/pomwithdependencies.rake index b12348e..03b6371 100644 --- a/tasks/pomwithdependencies.rake +++ b/tasks/pomwithdependencies.rake @@ -22,14 +22,16 @@ module Buildr module PomWithDependencies include Extension - # We have to add the dependencies to the monkey patched POM before the dependencies are - # changed in the compile, test and run after_define - after_define(:compile) do |project| - project.package.pom.dependencies = - [project.compile.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash)}.map { |a| a.to_hash.merge(:scope => 'compile') }, - project.test.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'test') }, - project.run.classpath.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'runtime') } - ].flatten + # We have to add the dependencies to the monkey patched POM before the dependencies are + # changed in the compile, test and run after_define + after_define(:compile) do |project| + deps = + [project.compile.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash)}.map { |a| a.to_hash.merge(:scope => 'compile') }, + project.test.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'test') }, + project.run.classpath.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'runtime') } + ].flatten + + project.packages.each {|pack| pack.pom.dependencies = deps} end end
