lib/maven/tools/dsl.rb in maven-tools-1.0.2 vs lib/maven/tools/dsl.rb in maven-tools-1.0.3

- old
+ new

@@ -151,11 +151,15 @@ execute_goal :initialize, :id => 'install gems' end end if pr && pr.dependencies.empty? - @current.profiles.delete( pr ) + if @current.respond_to? :delete + @current.profiles.delete( pr ) + else + @current.profiles.remove( pr ) + end end if pr && !pr.dependencies.empty? profile :gemfile_lock do activation do @@ -257,11 +261,12 @@ source = options[ :source ] || options[ 'source' ] build do source_directory source end end - if jar && ( source || + # TODO rename "no_rubygems_repo" to "no_jar_support" + if options[ :no_rubygems_repo ] != true && jar && ( source || ::File.exists?( ::File.join( basedir, 'src', 'main', 'java' ) ) ) unless spec.nil? || spec.platform.to_s.match( /java|jruby/ ) warn "gem is not a java platform gem but has a jar and source" end @@ -435,14 +440,12 @@ end else deps = all_deps( spec ) end - unless deps.java_runtime.empty? - deps.java_runtime.each do |d| - _dependency Maven::Tools::Artifact.new( *d ) - end + deps.java_dependency_artifacts.each do |a| + _dependency a end end def all_deps( spec ) deps = Maven::Tools::GemspecDependencies.new( spec ) @@ -1047,13 +1050,14 @@ end def _dependency( type, *args, &block ) do_dependency( false, type, *args, &block ) end - + alias :dependency_artifact :_dependency def _dependency!( type, *args, &block ) do_dependency( true, type, *args, &block ) end + alias :dependency_artifact! :_dependency! def _dependency?( type, *args ) find_dependency( dependency_container, retrieve_dependency( type, *args ) ) != nil end