ruby-maven 3.1.0.0.1 → 3.1.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 79bd459e51846e3410e134191ed92288b9a8bb07
4
+ data.tar.gz: 4c1afb5022a142a05e8be449e041d613f55cec58
5
+ SHA512:
6
+ metadata.gz: 69d0e141f9009a7a5f46fb156502d213d71ad447a14964a5ef19fbca6fd94c22568496b6679dc058cd8da7dab2d369aae7b1b01e04d36c74b1f021a4d613b1cb
7
+ data.tar.gz: 977ea680ae3de2721ea969fb2d4b73c2cc0dacc47a9878257bd3ea76bce83f7d335a8a3cb4a7342c57ae5d0bfe20d78e4161dcee3f4b0cc56a6c3d00320a9dbe
@@ -1,8 +1,9 @@
1
1
  main is org.apache.maven.cli.PolyglotMavenCli from plexus.core
2
2
 
3
3
  set maven.home default ${user.home}/m2
4
- set tesla.ext default ${maven.home}/ext
5
- set tesla.lib default ${maven.home}/lib
4
+ set tesla.home default ${user.home}/m2
5
+ set tesla.ext default ${tesla.home}/ext
6
+ set tesla.lib default ${tesla.home}/lib
6
7
 
7
8
  [plexus.core]
8
9
  load ${maven.home}/conf/logging
@@ -0,0 +1,5 @@
1
+ main is org.apache.maven.cli.PolyglotMavenCli from plexus.core
2
+
3
+ [plexus.core]
4
+ load ${maven.home}/conf/logging
5
+ load ${tesla.home}/ext/ruby/*.jar
@@ -19,9 +19,7 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
  unless defined? JRUBY_VERSION
22
- # require 'java'
23
22
  require 'maven/tools/model'
24
- require 'maven/tools/pom'
25
23
  end
26
24
  require 'maven/tools/visitor'
27
25
  require 'fileutils'
@@ -35,84 +33,41 @@ module Maven
35
33
 
36
34
  private
37
35
 
38
- def launch_jruby_embedded(args)
39
- classloader = self.class.class_world.get_realm( 'plexus.core' )
40
-
41
- cli = classloader.load_class( 'org.apache.maven.cli.PolyglotMavenCli' )
42
-
43
- a = java.util.ArrayList.new
44
- args.each { |arg| a << arg.to_s }
45
- unless org.apache.maven.cli.PolyglotMavenCli.main( a, self.class.class_world )
46
- raise 'error executing maven'
47
- end
48
- end
49
-
50
36
  def launch_jruby(args)
51
37
  java.lang.System.setProperty( "classworlds.conf",
52
- TeslaMaven.bin( "m2.conf" ) )
38
+ TeslaMaven.bin( "m2jruby.conf" ) )
53
39
 
54
40
  java.lang.System.setProperty( 'maven.home', TeslaMaven.maven_home )
55
- java.lang.System.setProperty( 'tesla.ext', TeslaMaven.ext )
56
- java.lang.System.setProperty( 'tesla.lib', TeslaMaven.lib )
41
+ java.lang.System.setProperty( 'tesla.home', TeslaMaven.home )
42
+
57
43
  # loading here is needed to let tesla-ruby find jruby on
58
- # classloader, though m2.conf does load those libs as well
44
+ # classloader
59
45
  self.class.require_classpath( TeslaMaven.maven_boot )
60
46
  self.class.require_classpath( TeslaMaven.maven_lib )
61
47
  self.class.require_classpath( TeslaMaven.lib )
62
- # NOTE that execution will call System.exit on the java side
63
- org.codehaus.plexus.classworlds.launcher.Launcher.main( args )
64
- end
65
48
 
66
- def self.class_world
67
- @class_world ||= class_world!
49
+ org.codehaus.plexus.classworlds.launcher.Launcher.main_with_exit_code( args )
68
50
  end
69
51
 
70
- def self.class_world!
71
- require_classpath( TeslaMaven.ext )
72
- require_classpath( TeslaMaven.lib )
73
- require_classpath( TeslaMaven.maven_boot )
74
- require_classpath( TeslaMaven.maven_lib )
75
- org.codehaus.plexus.classworlds.ClassWorld.new( "plexus.core",
76
- java.lang.Thread.currentThread().getContextClassLoader())
52
+ def launch_java(args)
53
+ # TODO works only on unix like OS
54
+ system "java -cp #{self.class.classpath( TeslaMaven.maven_boot )} -Dmaven.home=#{TeslaMaven.maven_home} -Dtesla.home=#{TeslaMaven.home} -Dclassworlds.conf=#{TeslaMaven.bin( 'm2.conf' )} org.codehaus.plexus.classworlds.launcher.Launcher #{args.join ' '}"
77
55
  end
78
56
 
79
57
  def self.classpath_array( dir )
80
58
  Dir.glob( File.join( dir, "*jar" ) )
81
59
  end
82
60
 
61
+ def self.classpath( dir )
62
+ classpath_array( dir ).join( File::PATH_SEPARATOR )
63
+ end
64
+
83
65
  def self.require_classpath( dir )
84
66
  classpath_array( dir ).each do |jar|
85
67
  require jar
86
68
  end
87
69
  end
88
70
 
89
- def adjust_args( args )
90
- if ! defined?( JRUBY_VERSION ) &&
91
- ( args.index( '-f' ) || args.index( '--file' ) ).nil?
92
-
93
- pom = ::Maven::Tools::POM.new
94
- pom_file = '.pom.xml'
95
- if pom.to_file( pom_file )
96
- args = args + [ '-f', pom_file ]
97
- else
98
- args
99
- end
100
- else
101
- args
102
- end
103
- end
104
-
105
- def launch_java(*args)
106
- # TODO works only on unix like OS
107
- result = system "java -cp #{self.class.classpath_array( ::Maven.boot ).join(':')} -Dmaven.home=#{::Maven.home} -Dclassworlds.conf=#{::Maven.bin( 'm2.conf' )} org.codehaus.plexus.classworlds.launcher.Launcher #{args.join ' '}"
108
-
109
- if @embedded and not result
110
- raise 'error in executing maven'
111
- else
112
- result
113
- end
114
- end
115
-
116
71
  def options_array
117
72
  options.collect do |k,v|
118
73
  if k =~ /^-D/
@@ -127,20 +82,15 @@ module Maven
127
82
  end
128
83
  end.flatten
129
84
  end
130
- private :options_array
131
85
 
132
86
  public
133
87
 
134
- def self.class_world
135
- @class_world ||= class_world!
136
- end
137
-
138
88
  def initialize( project = nil, temp_pom = nil )
139
89
  super()
140
90
  if project
141
91
  f = File.expand_path( temp_pom || '.pom.xml' )
142
92
  v = ::Maven::Tools::Visitor.new( File.open( f, 'w' ) )
143
- # parse block and write out to temp_pom file
93
+ # parse project and write out to temp_pom file
144
94
  v.accept_project( project )
145
95
  # tell maven to use the generated file
146
96
  options[ '-f' ] = f
@@ -162,7 +112,7 @@ module Maven
162
112
 
163
113
  def verbose
164
114
  if @verbose.nil?
165
- @verbose = options.delete('-Dverbose').to_s != 'false'
115
+ @verbose = options.delete('-Dverbose').to_s == 'true'
166
116
  else
167
117
  @verbose
168
118
  end
@@ -170,27 +120,38 @@ module Maven
170
120
 
171
121
  def exec(*args)
172
122
  a = args.dup + options_array
173
- a = adjust_args( a.flatten )
174
123
  if a.delete( '-Dverbose=true' ) || a.delete( '-Dverbose' ) || verbose
175
124
  puts "mvn #{a.join(' ')}"
125
+ end
126
+ if defined? Bundler
127
+ # it can be switching from ruby to jruby with invoking maven
128
+ # just keep it clean
129
+ Bundler.with_clean_env do
130
+ launch( a )
131
+ end
132
+ else
133
+ launch( a )
176
134
  end
135
+ end
136
+
137
+ def launch( args )
177
138
  if defined? JRUBY_VERSION
178
- if @embedded
179
- puts "using jruby #{JRUBY_VERSION} embedded invokation" if verbose
180
- launch_jruby_embedded(a)
181
- else
182
- puts "using jruby #{JRUBY_VERSION} invokation" if verbose
183
- launch_jruby(a)
184
- end
139
+ puts "using jruby #{JRUBY_VERSION} invokation" if verbose
140
+ result = launch_jruby( args )
185
141
  else
186
142
  puts "using java invokation" if verbose
187
- launch_java(a)
143
+ result = launch_java( args )
144
+ end
145
+ if @embedded and not result
146
+ raise "error in executing maven #{result}"
147
+ else
148
+ result
188
149
  end
189
150
  end
190
151
 
191
152
  def method_missing( method, *args )
192
153
  method = method.to_s.gsub( /_/, '-' ).to_sym
193
- exec( [ method ] + args )
154
+ exec( *([ method ] + args) )
194
155
  end
195
156
  end
196
157
  end
@@ -1,6 +1,7 @@
1
+ require 'maven'
1
2
  module Maven
2
3
  module Ruby
3
- MAVEN_VERSION = '3.1.0'
4
- VERSION = MAVEN_VERSION + '.0.1'
4
+ MAVEN_VERSION = ::Maven::VERSION
5
+ VERSION = MAVEN_VERSION + '.0.0'
5
6
  end
6
7
  end
@@ -6,7 +6,7 @@ end
6
6
 
7
7
  module TeslaMaven
8
8
 
9
- VERSION = '0.0.1'.freeze
9
+ VERSION = '0.0.9'.freeze
10
10
 
11
11
  def self.home
12
12
  File.expand_path( File.join( File.dirname( File.expand_path( __FILE__ ) ), '..' ) )
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-maven
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.0.1
5
- prerelease:
4
+ version: 3.1.1.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Christian Meier
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-16 00:00:00.000000000 Z
11
+ date: 2013-12-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: maven-tools
@@ -18,13 +17,11 @@ dependencies:
18
17
  - - ~>
19
18
  - !ruby/object:Gem::Version
20
19
  version: '0.33'
21
- none: false
22
20
  requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - ~>
25
23
  - !ruby/object:Gem::Version
26
24
  version: '0.33'
27
- none: false
28
25
  prerelease: false
29
26
  type: :runtime
30
27
  - !ruby/object:Gem::Dependency
@@ -33,14 +30,12 @@ dependencies:
33
30
  requirements:
34
31
  - - '='
35
32
  - !ruby/object:Gem::Version
36
- version: 3.1.0
37
- none: false
33
+ version: 3.1.1
38
34
  requirement: !ruby/object:Gem::Requirement
39
35
  requirements:
40
36
  - - '='
41
37
  - !ruby/object:Gem::Version
42
- version: 3.1.0
43
- none: false
38
+ version: 3.1.1
44
39
  prerelease: false
45
40
  type: :runtime
46
41
  - !ruby/object:Gem::Dependency
@@ -50,13 +45,11 @@ dependencies:
50
45
  - - ~>
51
46
  - !ruby/object:Gem::Version
52
47
  version: '5.0'
53
- none: false
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - ~>
57
51
  - !ruby/object:Gem::Version
58
52
  version: '5.0'
59
- none: false
60
53
  prerelease: false
61
54
  type: :development
62
55
  - !ruby/object:Gem::Dependency
@@ -66,13 +59,11 @@ dependencies:
66
59
  - - ~>
67
60
  - !ruby/object:Gem::Version
68
61
  version: '10.0'
69
- none: false
70
62
  requirement: !ruby/object:Gem::Requirement
71
63
  requirements:
72
64
  - - ~>
73
65
  - !ruby/object:Gem::Version
74
66
  version: '10.0'
75
- none: false
76
67
  prerelease: false
77
68
  type: :development
78
69
  description: maven support for ruby based on tesla maven. MRI needs java/javac command installed.
@@ -84,9 +75,10 @@ extensions: []
84
75
  extra_rdoc_files: []
85
76
  files:
86
77
  - bin/rmvn
78
+ - bin/m2jruby.conf
87
79
  - bin/m2.conf
88
- - ext/ruby/maven-tools-0.33.1-SNAPSHOT.jar
89
- - ext/ruby/tesla-polyglot-ruby-0.0.1-SNAPSHOT.jar
80
+ - ext/ruby/maven-tools-0.34.1.jar
81
+ - ext/ruby/tesla-polyglot-ruby-0.0.9.jar
90
82
  - ruby/ruby-maven.rb
91
83
  - ruby/tesla_maven.rb
92
84
  - ruby/ruby_maven.rb
@@ -94,11 +86,12 @@ files:
94
86
  - ruby/maven/ruby/version.rb
95
87
  - ruby/maven/ruby/maven.rb
96
88
  - ruby/maven/ruby/tasks.rb
97
- - lib/tesla-polyglot-common-0.0.1-SNAPSHOT.jar
98
- - lib/tesla-polyglot-cli-0.0.1-SNAPSHOT.jar
89
+ - lib/tesla-polyglot-cli-0.0.9.jar
90
+ - lib/tesla-polyglot-common-0.0.9.jar
99
91
  homepage: https://github.com/tesla/tesla-polyglot/tree/master/tesla-polyglot-gem
100
92
  licenses:
101
93
  - EPL
94
+ metadata: {}
102
95
  post_install_message:
103
96
  rdoc_options:
104
97
  - --main
@@ -110,17 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
103
  - - '>='
111
104
  - !ruby/object:Gem::Version
112
105
  version: '0'
113
- none: false
114
106
  required_rubygems_version: !ruby/object:Gem::Requirement
115
107
  requirements:
116
108
  - - '>='
117
109
  - !ruby/object:Gem::Version
118
110
  version: '0'
119
- none: false
120
111
  requirements: []
121
112
  rubyforge_project:
122
- rubygems_version: 1.8.24
113
+ rubygems_version: 2.1.9
123
114
  signing_key:
124
- specification_version: 3
115
+ specification_version: 4
125
116
  summary: maven support for ruby projects
126
117
  test_files: []