class Maven::Tools::Jarfile::DSL

Public Class Methods

eval_file( file ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 79
def self.eval_file( file )
  jarfile = self.new
  jarfile.eval_file( file )
end

Public Instance Methods

artifacts() click to toggle source
# File lib/maven/tools/jarfile.rb, line 92
def artifacts
  @artifacts ||= []
end
eval_file( file ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 84
def eval_file( file )
  warn "#{self.class} is deprecated"
  if ::File.exists?( file )
    eval( ::File.read( file ), nil, file )
    self
  end
end
jar( *args ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 108
def jar( *args )
  a = Artifact.from( :jar, *args )
  a[ :scope ] = @scope if @scope
  artifacts << a
  a
end
jruby( version = nil, no_asm = false ) { || ... } click to toggle source

TODO add flag to use repacked asm

# File lib/maven/tools/jarfile.rb, line 138
def jruby( version = nil, no_asm = false )
  if version
    @jruby = version 
    @jruby += '-no_asm' if no_asm
  end
  @scope = :provided
  yield if block_given?
  @jruby
ensure
  @scope = nil
end
local( path ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 104
def local( path )
  artifacts << Artifact.new_local( ::File.expand_path( path ), :jar )
end
pom( *args ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 115
def pom( *args )
  a = Artifact.from( :pom, *args )
  a[ :scope ] = @scope if @scope
  artifacts << a
  a
end
repositories() click to toggle source
# File lib/maven/tools/jarfile.rb, line 96
def repositories
  @repositories ||= []
end
repository( name, url = nil ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 129
def repository( name, url = nil )
  if url.nil?
    url = name
  end
  repositories << { :name => name.to_s, :url => url }
end
Also aliased as: source
scope( scope ) { || ... } click to toggle source
# File lib/maven/tools/jarfile.rb, line 150
def scope( scope )
  @scope = scope
  yield if block_given?
ensure
  @scope = nil
end
snapshot_repositories() click to toggle source
# File lib/maven/tools/jarfile.rb, line 100
def snapshot_repositories
  @snapshot_repositories ||= []
end
snapshot_repository( name, url = nil ) click to toggle source
# File lib/maven/tools/jarfile.rb, line 122
def snapshot_repository( name, url = nil )
  if url.nil?
    url = name
  end
  snapshot_repositories << { :name => name.to_s, :url => url }
end
source( name, url = nil )
Alias for: repository