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,322 @@
1
+ module Maven
2
+ module Model
3
+ class Tag
4
+
5
+ def self.prepend_tags(*tags)
6
+ _tags(true, *tags)
7
+ end
8
+
9
+ def self.tags(*tags)
10
+ _tags(false, *tags)
11
+ end
12
+
13
+ def self._tags(prepend, *tags)
14
+ if tags.size == 0
15
+ @tags
16
+ else
17
+ #self.send :attr_accessor, *tags
18
+ tags.each do |tag|
19
+ eval <<-EOF
20
+ def #{tag.to_s}(val = nil)
21
+ @#{tag.to_s} = val if val
22
+ @#{tag.to_s}
23
+ end
24
+ def #{tag.to_s}=(val)
25
+ @#{tag.to_s} = val
26
+ end
27
+ EOF
28
+ end
29
+ if self.superclass.respond_to?:tags
30
+ @tags ||= (self.superclass.tags || []).dup
31
+ else
32
+ @tags ||= []
33
+ end
34
+ unless @tags.include? tags[0]
35
+ if prepend
36
+ @tags.replace([tags, @tags].flatten)
37
+ else
38
+ @tags.replace([@tags, tags].flatten)
39
+ end
40
+ end
41
+ @tags
42
+ end
43
+ end
44
+
45
+ def _name
46
+ self.class.to_s.downcase.sub(/.*::/, '')
47
+ end
48
+
49
+ def initialize(args = {})
50
+ warn "deprecated #{args.inspect}" if args.size > 0
51
+ args.each do |k,v|
52
+ send("#{k}=".to_sym, v)
53
+ end
54
+ end
55
+
56
+ def comment(c)
57
+ @comment = c if c
58
+ @comment
59
+ end
60
+
61
+ def to_xml(buf = "", indent = "")
62
+ buf << "#{indent}<#{_name}>\n"
63
+ buf << "#{indent}<!--\n#{indent}#{@comment}\n#{indent}-->\n" if @comment
64
+ self.class.tags.each do |var|
65
+ val = instance_variable_get("@#{var}".to_sym)
66
+ var = var.to_s.gsub(/_(.)/) { $1.upcase }
67
+ case val
68
+ when Array
69
+ val.flatten!
70
+ if val.size > 0
71
+ buf << "#{indent} <#{var}>\n"
72
+ val.each do |v|
73
+ if v.is_a? Tag
74
+ v.to_xml(buf, indent + " ")
75
+ else
76
+ buf << "#{indent} <#{var.to_s.sub(/s$/, '')}>#{v}</#{var.to_s.sub(/s$/, '')}>\n"
77
+ end
78
+ end
79
+ buf << "#{indent} </#{var}>\n"
80
+ end
81
+ when Hash
82
+ if val.size > 0
83
+ buf << "#{indent} <#{var}>\n"
84
+ val.each do |k, v|
85
+ if v.is_a? Tag
86
+ v.to_xml(buf, indent + " ")
87
+ else
88
+ buf << "#{indent} <#{k}>#{v}</#{k}>\n"
89
+ end
90
+ end
91
+ buf << "#{indent} </#{var}>\n"
92
+ end
93
+ when Tag
94
+ val.to_xml(buf, indent + " ")
95
+ else
96
+ #when String
97
+ buf << "#{indent} <#{var}>#{val}</#{var}>\n" if val
98
+ end
99
+ end
100
+ buf << "#{indent}</#{_name}>\n"
101
+ buf
102
+ end
103
+ end
104
+
105
+ class NamedArray < Array
106
+ attr_reader :name
107
+ def initialize(name, &block)
108
+ @name = name.to_s
109
+ if block
110
+ block.call(self)
111
+ end
112
+ self
113
+ end
114
+ end
115
+
116
+ class ModelHash < Hash
117
+
118
+ def initialize(clazz)
119
+ @clazz = clazz
120
+ end
121
+
122
+ def get(key, &block)
123
+ key = key.to_sym if key
124
+ result = self[key]
125
+ if result.nil?
126
+ result = (self[key] = @clazz.new(key))
127
+ end
128
+ if block
129
+ block.call(result)
130
+ end
131
+ result
132
+ end
133
+ alias :new :get
134
+ alias :add :get
135
+
136
+ def default_model
137
+ @default_model ||=
138
+ begin
139
+ model = @clazz.new
140
+ self[nil] = model
141
+ model
142
+ end
143
+ end
144
+
145
+ def method_missing(method, *args, &block)
146
+ default_model.send(method, *args, &block)
147
+ end
148
+ end
149
+
150
+ class DeveloperHash < Hash
151
+
152
+ def get(*args, &block)
153
+ developer = if args.size == 1 && args[0].is_a?(Developer)
154
+ args[0]
155
+ else
156
+ Developer.new(*args)
157
+ end
158
+ self[developer.id] = developer
159
+ if block
160
+ block.call(developer)
161
+ end
162
+ developer
163
+ end
164
+ alias :new :get
165
+ alias :add :get
166
+ end
167
+
168
+ class LicenseHash < Hash
169
+
170
+ def get(*args, &block)
171
+ license = if args.size == 1 && args[0].is_a?(License)
172
+ args[0]
173
+ else
174
+ License.new(*args)
175
+ end
176
+ self[license.name] = license
177
+ if block
178
+ block.call(license)
179
+ end
180
+ license
181
+ end
182
+ alias :new :get
183
+ alias :add :get
184
+ end
185
+
186
+ class PluginHash < Hash
187
+
188
+ def adjust_key(name)
189
+ name = name.to_s
190
+ if (name =~ /\:/).nil?
191
+ if [:jruby, :gem, :rspec, :rake, :rails2, :rails3, :gemify, :cucumber, :runit, :bundler].member? name.to_sym
192
+ "de.saumya.mojo:#{name}-maven-plugin"
193
+ else
194
+ "maven-#{name}-plugin"
195
+ end
196
+ else
197
+ name
198
+ end
199
+ end
200
+
201
+ def key?(k)
202
+ super( adjust_key(k).to_sym )
203
+ end
204
+
205
+ def get(*args, &block)
206
+ case args.size
207
+ when 3
208
+ name = "#{args[0]}:#{args[1]}"
209
+ version = args[2]
210
+ when 2
211
+ name = args[0].to_s
212
+ version = args[1]
213
+ when 1
214
+ name = args[0].to_s
215
+ else
216
+ raise "need name"
217
+ end
218
+
219
+ name = adjust_key(name)
220
+ group_id = name =~ /\:/ ? name.sub(/:.+$/, '') : nil
221
+ artifact_id = name.sub(/^.+:/, '')
222
+
223
+ k = "#{group_id}:#{artifact_id}".to_sym
224
+ result = self[k]
225
+ if result.nil?
226
+ result = (self[k] = Plugin.new(group_id, artifact_id, version))
227
+ end
228
+ result.version = version if version
229
+ if block
230
+ block.call(result)
231
+ end
232
+ result
233
+ end
234
+ alias :new :get
235
+ alias :add :get
236
+
237
+ end
238
+
239
+ class ListItems < Tag
240
+
241
+ def initialize(name = nil)
242
+ @name = name
243
+ end
244
+
245
+ def add(item)
246
+ @items ||= Array.new
247
+ @items << item
248
+ end
249
+ alias :<< :add
250
+
251
+ def to_xml(buf = "", indent = "")
252
+ buf << "#{indent}<#{@name}>\n" if @name
253
+ buf << "#{indent}<!--\n#{indent}#{@comment}\n#{indent}-->\n" if @comment
254
+ @items.each do |i|
255
+ i.to_xml(buf, indent)
256
+ end
257
+ buf << "#{indent}</#{@name}>\n" if @name
258
+ end
259
+
260
+ end
261
+
262
+ class HashTag < Tag
263
+
264
+ def initialize(name, args = {})
265
+ @name = name
266
+ @props = args
267
+ end
268
+
269
+ def [](key)
270
+ @props ||= {}
271
+ @props[key]
272
+ end
273
+
274
+ def []=(key, value)
275
+ @props ||= {}
276
+ @props[key] = value
277
+ end
278
+
279
+ def to_xml(buf = "", indent = "")
280
+ buf << "#{indent}<#{@name}>\n"
281
+ buf << "#{indent}<!--\n#{indent}#{@comment}\n#{indent}-->\n" if @comment
282
+ map_to_xml(buf, indent, @props)
283
+ buf << "#{indent}</#{@name}>\n"
284
+ end
285
+
286
+ def map_to_xml(buf, indent, map)
287
+ # sort the hash over the keys
288
+ map.collect { |k,v| [k.to_s, v]}.sort.each do |k,v|
289
+ case v
290
+ when Hash
291
+ buf << "#{indent} <#{k}>\n"
292
+ map_to_xml(buf, indent + " ", v)
293
+ buf << "#{indent} </#{k}>\n"
294
+ when NamedArray
295
+ buf << "#{indent} <#{k}>\n"
296
+ v.each do|i|
297
+ buf << "#{indent} <#{v.name}>\n"
298
+ case i
299
+ when Hash
300
+ map_to_xml(buf, indent + " ", i)
301
+ end
302
+ buf << "#{indent} </#{v.name}>\n"
303
+ end
304
+ buf << "#{indent} </#{k}>\n"
305
+ when Array
306
+ buf << "#{indent} <#{k}>\n"
307
+ singular = k.to_s.sub(/s$/, '')
308
+ v.each do |i|
309
+ buf << "#{indent} <#{singular}>#{i}</#{singular}>\n"
310
+ end
311
+ buf << "#{indent} </#{k}>\n"
312
+ when /\n$/
313
+ buf << "#{indent} <#{k}>#{v}"
314
+ buf << "#{indent} </#{k}>\n"
315
+ else
316
+ buf << "#{indent} <#{k}>#{v}</#{k}>\n"
317
+ end
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'gem_project.rb')
2
+
3
+ proj = Maven::Tools::GemProject.new("in_phase_execution")
4
+
5
+ proj.load(ARGV[0])
6
+
7
+ block = proj.executions_in_phase[ARGV[1]]
8
+ block.call if block
9
+