Module: Maven

Defined in:
lib/maven.rb

Constant Summary collapse

VERSION =
'3.9.9'.freeze

Class Method Summary collapse

Class Method Details

.bin(file = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/maven.rb', line 23

def self.bin( file = nil )
  if file
    File.join( path( 'bin' ), file )
  else
    path( 'bin' )
  end
end

.bootObject



39
40
41
# File 'lib/maven.rb', line 39

def self.boot
  path( 'boot' )
end

.confObject



35
36
37
# File 'lib/maven.rb', line 35

def self.conf
  path( 'conf' )
end

.exec(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/maven.rb', line 5

def self.exec( *args )
  if args.member?( '-Dverbose=true' ) || args.member?( '-Dverbose' ) || args.member?( '-X' )
    puts "mvn #{args.join(' ')}"
  end
  old_maven_home = ENV['M2_HOME']
  ENV['M2_HOME'] = home
  system "#{Maven.bin( 'mvn' )} #{args.join( ' ' )}"
ensure
  ENV['M2_HOME'] = old_maven_home
end

.homeObject



16
17
18
19
20
21
# File 'lib/maven.rb', line 16

def self.home
  @home ||= begin
              dir = File.dirname( File.expand_path( __FILE__ ) )
              File.expand_path( "#{dir}/../maven-home" )
            end
end

.libObject



31
32
33
# File 'lib/maven.rb', line 31

def self.lib
  path( 'lib' )
end