ruby-maven 3.0.3.0.28.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/LICENSE.txt +202 -0
  2. data/NOTICE.txt +23 -0
  3. data/README.txt +77 -0
  4. data/bin/gwt +59 -0
  5. data/bin/jetty-run +25 -0
  6. data/bin/m2.conf +7 -0
  7. data/bin/mvn +172 -0
  8. data/bin/mvn.bat +197 -0
  9. data/bin/mvnDebug +177 -0
  10. data/bin/mvnDebug.bat +200 -0
  11. data/bin/mvnyjp +193 -0
  12. data/bin/rmvn +9 -0
  13. data/bin/tomcat-run +25 -0
  14. data/boot/plexus-classworlds-2.4.jar +0 -0
  15. data/conf/settings.xml +257 -0
  16. data/lib/aether-api-1.11.jar +0 -0
  17. data/lib/aether-connector-wagon-1.11.jar +0 -0
  18. data/lib/aether-impl-1.11.jar +0 -0
  19. data/lib/aether-spi-1.11.jar +0 -0
  20. data/lib/aether-util-1.11.jar +0 -0
  21. data/lib/commons-cli-1.2.jar +0 -0
  22. data/lib/ext/README.txt +2 -0
  23. data/lib/maven-aether-provider-3.0.3.jar +0 -0
  24. data/lib/maven-artifact-3.0.3.jar +0 -0
  25. data/lib/maven-compat-3.0.3.jar +0 -0
  26. data/lib/maven-core-3.0.3.jar +0 -0
  27. data/lib/maven-embedder-3.0.3.jar +0 -0
  28. data/lib/maven-model-3.0.3.jar +0 -0
  29. data/lib/maven-model-builder-3.0.3.jar +0 -0
  30. data/lib/maven-plugin-api-3.0.3.jar +0 -0
  31. data/lib/maven-repository-metadata-3.0.3.jar +0 -0
  32. data/lib/maven-settings-3.0.3.jar +0 -0
  33. data/lib/maven-settings-builder-3.0.3.jar +0 -0
  34. data/lib/nekohtml-1.9.6.2.jar +0 -0
  35. data/lib/plexus-cipher-1.4.jar +0 -0
  36. data/lib/plexus-component-annotations-1.5.5.jar +0 -0
  37. data/lib/plexus-interpolation-1.14.jar +0 -0
  38. data/lib/plexus-sec-dispatcher-1.3.jar +0 -0
  39. data/lib/plexus-utils-2.0.6.jar +0 -0
  40. data/lib/ruby/maven/model/dependencies.rb +281 -0
  41. data/lib/ruby/maven/model/model.rb +490 -0
  42. data/lib/ruby/maven/model/model_utils.rb +322 -0
  43. data/lib/ruby/maven/tools/execute_in_phase.rb +9 -0
  44. data/lib/ruby/maven/tools/gem_project.rb +387 -0
  45. data/lib/ruby/maven/tools/gemfile_lock.rb +67 -0
  46. data/lib/ruby/maven/tools/pom_generator.rb +61 -0
  47. data/lib/ruby/maven/tools/rails_project.rb +147 -0
  48. data/lib/ruby/maven/tools/versions.rb +11 -0
  49. data/lib/ruby/ruby_maven.rb +206 -0
  50. data/lib/sisu-guice-2.9.4-no_aop.jar +0 -0
  51. data/lib/sisu-inject-bean-2.1.1.jar +0 -0
  52. data/lib/sisu-inject-plexus-2.1.1.jar +0 -0
  53. data/lib/wagon-file-1.0-beta-7.jar +0 -0
  54. data/lib/wagon-http-lightweight-1.0-beta-7.jar +0 -0
  55. data/lib/wagon-http-shared-1.0-beta-7.jar +0 -0
  56. data/lib/wagon-provider-api-1.0-beta-7.jar +0 -0
  57. data/lib/xercesMinimal-1.9.6.2.jar +0 -0
  58. metadata +128 -0
@@ -0,0 +1,206 @@
1
+ require 'fileutils'
2
+ require 'maven/tools/rails_project'
3
+
4
+ module Maven
5
+ class RubyMaven
6
+
7
+ # make the command line for the goals of the jruby-maven-plugins nicer
8
+ PLUGINS = {
9
+ :rake => [:rake],
10
+ :jruby => [:jruby, :compile],
11
+ :gem => [:package, :install, :push, :exec, :pom, :initialize, :irb],
12
+ :gemify => [:gemify, :versions],
13
+ :rails2 => [:new, :generate, :rake, :server, :console],
14
+ :rails3 => [:new, :generate, :rake, :server, :console, :dbconsole, :pom, :initialize],
15
+ :cucumber => [:test],
16
+ :rspec => [:test],
17
+ :runit => [:test],
18
+ :bundler => [:install]
19
+ }
20
+ ALIASES = {
21
+ :ruby => :jruby,
22
+ :spec => :rspec,
23
+ :rails => :rails3,
24
+ :bundle => :bundler
25
+ }
26
+
27
+ def initialize
28
+ @maven_home = File.expand_path(File.join(File.dirname(__FILE__),'..','..'))
29
+ end
30
+
31
+ def launch_jruby(args)
32
+ classpath_array.each do |path|
33
+ require path
34
+ end
35
+
36
+ java.lang.System.setProperty("classworlds.conf",
37
+ File.join(@maven_home, 'bin', "m2.conf"))
38
+
39
+ java.lang.System.setProperty("maven.home", @maven_home)
40
+
41
+ org.codehaus.plexus.classworlds.launcher.Launcher.main(args)
42
+ end
43
+
44
+ def classpath_array
45
+ Dir.glob(File.join(@maven_home, "boot", "*jar")) +
46
+ Dir.glob(File.join(@maven_home, "ext", "ruby-tools*jar"))
47
+ end
48
+
49
+ def launch_java(*args)
50
+ system "java -cp #{classpath_array.join(':')} -Dmaven.home=#{File.expand_path(@maven_home)} -Dclassworlds.conf=#{File.expand_path(File.join(@maven_home, 'bin', 'm2.conf'))} org.codehaus.plexus.classworlds.launcher.Launcher #{args.join ' '}"
51
+ end
52
+
53
+ def prepare(args)
54
+ if args.size > 0
55
+ name = args[0].to_sym
56
+ name = ALIASES[name] || name
57
+ if PLUGINS.member?(name)
58
+ start = 1
59
+ if args.size > 1
60
+ if PLUGINS[name].member? args[1].to_sym
61
+ goal = args[1].to_sym
62
+ start = 2
63
+ else
64
+ goal = PLUGINS[name][0]
65
+ end
66
+ else
67
+ goal = PLUGINS[name][0]
68
+ end
69
+ # determine the version and delete from args if given
70
+ version = args.detect do |a|
71
+ a =~ /^-Dplugin.version=/
72
+ end
73
+
74
+ if version
75
+ args.delete(version)
76
+ version = version.sub(/^-Dplugin.version=/, ':')
77
+ end
78
+ aa = if index = args.index("--")
79
+ args[(index + 1)..-1]
80
+ else
81
+ []
82
+ end
83
+ ruby_args = (args[start, (index || 1000) - start] || []).join(' ')
84
+
85
+ aa << "de.saumya.mojo:#{name}-maven-plugin#{version}:#{goal}"
86
+ aa << "-Dargs=\"#{ruby_args}\"" if ruby_args.size > 0
87
+ args.replace(aa)
88
+ else
89
+ args.delete("--")
90
+ end
91
+ end
92
+ args
93
+ end
94
+
95
+ def log(args)
96
+ log = File.join('log', 'rmvn.log')
97
+ if File.exists? File.dirname(log)
98
+ File.open(log, 'a') do |f|
99
+ f.puts "rmvn #{args.join ' '}"
100
+ end
101
+ end
102
+ end
103
+
104
+ def maybe_print_help(args)
105
+ if args.size == 0 || args[0] == "--help"
106
+ puts "usage: rmvn [<plugin-name> [<args>] [-- <maven-options>]] | [<maven-goal>|<maven-phase> <maven-options>] | --help"
107
+ PLUGINS.each do |name, goals|
108
+ puts
109
+ print "plugin #{name}"
110
+ print " - alias: #{ALIASES.invert[name]}" if ALIASES.invert[name]
111
+ puts
112
+ if goals.size > 1
113
+ print "\tgoals : #{goals.join(',')}"
114
+ puts
115
+ end
116
+ print "\tdefault goal: #{goals[0]}"
117
+ puts
118
+ end
119
+ puts
120
+ ["--help"]
121
+ else
122
+ args
123
+ end
124
+ end
125
+
126
+ def options
127
+ @options ||= {}
128
+ end
129
+
130
+ def options_string
131
+ options_array.join ' '
132
+ end
133
+
134
+ def options_array
135
+ options.collect do |k,v|
136
+ if k =~ /^-D/
137
+ v = "=#{v}" if v
138
+ else
139
+ v = " #{v}" if v
140
+ end
141
+ "#{k}#{v}"
142
+ end
143
+ end
144
+
145
+ def command_line(args)
146
+ args = prepare(args)
147
+ args = maybe_print_help(args)
148
+ args
149
+ end
150
+
151
+ def generate_pom(*args)
152
+ unless args.member?("-f") || args.member?("--file")
153
+ gemfiles = Dir["*Gemfile"]
154
+ gemfiles.delete_if {|g| g =~ /.pom/}
155
+ if gemfiles.size > 0
156
+ proj =
157
+ if File.exists? File.join( 'config', 'application.rb' )
158
+ Maven::Tools::RailsProject.new
159
+ else
160
+ Maven::Tools::GemProject.new
161
+ end
162
+ filename = gemfiles[0]
163
+ proj.load(filename)
164
+ else
165
+ gemspecs = Dir["*.gemspec"]
166
+ gemspecs.delete_if {|g| g =~ /.pom/}
167
+ if gemspecs.size > 0
168
+ proj = Maven::Tools::GemProject.new
169
+ filename = gemspecs[0]
170
+ proj.load_gemspec(filename)
171
+ end
172
+ end
173
+ if filename
174
+ proj.load(File.join(File.dirname(filename), 'Mavenfile'))
175
+ proj.add_defaults
176
+ pom = filename + ".pom"
177
+ File.open(pom, 'w') do |f|
178
+ f.puts proj.to_xml
179
+ end
180
+ args << '-f'
181
+ args << pom
182
+ end
183
+ end
184
+ args
185
+ end
186
+
187
+ def exec(*args)
188
+ a = command_line(args.dup.flatten)
189
+ a << options_array
190
+ a.flatten!
191
+ a = generate_pom(a)
192
+ puts a.join ' '
193
+ if defined? JRUBY_VERSION
194
+ launch_jruby(a)
195
+ else
196
+ launch_java(a)
197
+ end
198
+ end
199
+
200
+ def exec_in(launchdirectory, *args)
201
+ FileUtils.cd(launchdirectory) do
202
+ exec(args)
203
+ end
204
+ end
205
+ end
206
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-maven
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 3.0.3.0.28.4
6
+ platform: ruby
7
+ authors:
8
+ - mkristian
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-09-25 00:00:00 +05:30
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: thor
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 0.14.6
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description: maven support for rubygems based on maven 3.0. it allows to use xyz.gemspec file as pom file or the usual pom.xml files. with a rails3 application with a Gemfile (suitable for jruby) you can run jetty as development server. this gem is a stripped polyglot-maven which includes only the jruby part. the executable runs only with jruby.
28
+ email:
29
+ - m.kristian@web.de
30
+ executables:
31
+ - rmvn
32
+ - gwt
33
+ - jetty-run
34
+ extensions: []
35
+
36
+ extra_rdoc_files:
37
+ - NOTICE.txt
38
+ - LICENSE.txt
39
+ - README.txt
40
+ files:
41
+ - LICENSE.txt
42
+ - NOTICE.txt
43
+ - README.txt
44
+ - bin/gwt
45
+ - bin/tomcat-run
46
+ - bin/jetty-run
47
+ - bin/mvnDebug.bat
48
+ - bin/mvn
49
+ - bin/mvn.bat
50
+ - bin/mvnyjp
51
+ - bin/mvnDebug
52
+ - bin/rmvn
53
+ - bin/m2.conf
54
+ - boot/plexus-classworlds-2.4.jar
55
+ - conf/settings.xml
56
+ - lib/plexus-cipher-1.4.jar
57
+ - lib/maven-core-3.0.3.jar
58
+ - lib/aether-util-1.11.jar
59
+ - lib/maven-settings-builder-3.0.3.jar
60
+ - lib/wagon-provider-api-1.0-beta-7.jar
61
+ - lib/maven-settings-3.0.3.jar
62
+ - lib/maven-embedder-3.0.3.jar
63
+ - lib/maven-aether-provider-3.0.3.jar
64
+ - lib/plexus-component-annotations-1.5.5.jar
65
+ - lib/wagon-http-shared-1.0-beta-7.jar
66
+ - lib/maven-model-builder-3.0.3.jar
67
+ - lib/maven-repository-metadata-3.0.3.jar
68
+ - lib/maven-model-3.0.3.jar
69
+ - lib/aether-spi-1.11.jar
70
+ - lib/wagon-file-1.0-beta-7.jar
71
+ - lib/plexus-utils-2.0.6.jar
72
+ - lib/aether-connector-wagon-1.11.jar
73
+ - lib/aether-impl-1.11.jar
74
+ - lib/nekohtml-1.9.6.2.jar
75
+ - lib/sisu-inject-plexus-2.1.1.jar
76
+ - lib/plexus-interpolation-1.14.jar
77
+ - lib/maven-plugin-api-3.0.3.jar
78
+ - lib/wagon-http-lightweight-1.0-beta-7.jar
79
+ - lib/aether-api-1.11.jar
80
+ - lib/sisu-guice-2.9.4-no_aop.jar
81
+ - lib/maven-artifact-3.0.3.jar
82
+ - lib/maven-compat-3.0.3.jar
83
+ - lib/commons-cli-1.2.jar
84
+ - lib/xercesMinimal-1.9.6.2.jar
85
+ - lib/sisu-inject-bean-2.1.1.jar
86
+ - lib/plexus-sec-dispatcher-1.3.jar
87
+ - lib/ext/README.txt
88
+ - lib/ruby/ruby_maven.rb
89
+ - lib/ruby/maven/tools/execute_in_phase.rb
90
+ - lib/ruby/maven/tools/rails_project.rb
91
+ - lib/ruby/maven/tools/gem_project.rb
92
+ - lib/ruby/maven/tools/pom_generator.rb
93
+ - lib/ruby/maven/tools/gemfile_lock.rb
94
+ - lib/ruby/maven/tools/versions.rb
95
+ - lib/ruby/maven/model/model_utils.rb
96
+ - lib/ruby/maven/model/model.rb
97
+ - lib/ruby/maven/model/dependencies.rb
98
+ has_rdoc: true
99
+ homepage: http://github.com/mkristian/ruby-maven
100
+ licenses: []
101
+
102
+ post_install_message:
103
+ rdoc_options:
104
+ - --main
105
+ - README.md
106
+ require_paths:
107
+ - lib/ruby
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: "0"
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ">"
118
+ - !ruby/object:Gem::Version
119
+ version: 1.3.1
120
+ requirements: []
121
+
122
+ rubyforge_project:
123
+ rubygems_version: 1.5.1
124
+ signing_key:
125
+ specification_version: 3
126
+ summary: maven support for ruby projects with gemspec, Gemfile
127
+ test_files: []
128
+