maven-tools 0.32.0 → 0.32.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/lib/maven-tools.rb +20 -0
  2. data/lib/maven/model/dependencies.rb +21 -1
  3. data/lib/maven/model/model.rb +21 -1
  4. data/lib/maven/model/utils.rb +21 -1
  5. data/lib/maven/tools/coordinate.rb +21 -1
  6. data/lib/maven/tools/execute_in_phase.rb +20 -1
  7. data/lib/maven/tools/gem_project.rb +39 -3
  8. data/lib/maven/tools/gemfile_lock.rb +21 -1
  9. data/lib/maven/tools/jarfile.rb +21 -1
  10. data/lib/maven/tools/minimal_project.rb +21 -1
  11. data/lib/maven/tools/pom_generator.rb +21 -1
  12. data/lib/maven/tools/rails_project.rb +23 -2
  13. data/lib/maven/tools/version.rb +21 -1
  14. data/lib/maven/tools/versions.rb +25 -5
  15. data/lib/maven_tools.rb +20 -0
  16. data/rspec/maven/model/dependencies_spec.rb +260 -0
  17. data/rspec/maven/model/model_spec.rb +713 -0
  18. data/rspec/maven/tools/Gemfile.gems +11 -0
  19. data/rspec/maven/tools/Gemfile.groups +15 -0
  20. data/rspec/maven/tools/Gemfile.ignored +30 -0
  21. data/rspec/maven/tools/Gemfile.lockfile +8 -0
  22. data/rspec/maven/tools/Gemfile.lockfile.lock +53 -0
  23. data/rspec/maven/tools/Gemfile.minimal +1 -0
  24. data/rspec/maven/tools/Gemfile.nolock +1 -0
  25. data/rspec/maven/tools/Gemfile.rails +16 -0
  26. data/rspec/maven/tools/Gemfile.simple +7 -0
  27. data/rspec/maven/tools/Gemfile.withlock +1 -0
  28. data/rspec/maven/tools/Gemfile.withlock.lock +28 -0
  29. data/rspec/maven/tools/Jarfile.with +2 -0
  30. data/rspec/maven/tools/Jarfile.with.lock +1 -0
  31. data/rspec/maven/tools/Jarfile.without +2 -0
  32. data/rspec/maven/tools/deps.gemspec +8 -0
  33. data/rspec/maven/tools/gem_project_spec.rb +1127 -0
  34. data/rspec/maven/tools/maven-tools.gemspec +17 -0
  35. data/rspec/maven/tools/minimal.gemspec +5 -0
  36. data/rspec/maven/tools/no-deps.gemspec +27 -0
  37. data/rspec/maven/tools/rails_project_spec.rb +286 -0
  38. data/rspec/maven/tools/spec_helper.rb +22 -0
  39. metadata +66 -3
@@ -0,0 +1,11 @@
1
+ gem 'rspec', :platforms => :mri
2
+ gem 'dm-core', :platforms => :ruby
3
+ gem 'ixtlan-core', :platforms => :jruby
4
+ gem 'ixtlan-error-handler', :platforms => :mswin
5
+ gem 'facest', :path => "../facets"
6
+ gem 'rails', :git =>"git://github.com/rails/rails.git" , :platforms => :jruby, :group => :integration
7
+
8
+ gem 'dm-sqlite3-adapter', '~> 0.10.0', :group => :test
9
+ gem 'dm-mysql-adapter', ['~> 0.10.0', '< 0.10.3'], :group => [:development, :production]
10
+ gem 'dm-oracle-adapter', ['~> 0.10.0'], :group => :test, :platforms => :mswin
11
+ gem 'dm-hsqldb-adapter', '= 0.10.0', :group => :development, :platforms => [:ruby, :jruby]
@@ -0,0 +1,15 @@
1
+ group :test, :production do
2
+ gem 'rspec', :platforms => :mri
3
+ gem 'dm-core', :platforms => :ruby
4
+ gem 'ixtlan-core', :platforms => :jruby
5
+ gem 'ixtlan-error-handler', :platforms => :mswin
6
+ end
7
+
8
+ group :development do
9
+ gem 'dm-sqlite-adapter', '~> 1.0.0'
10
+ end
11
+
12
+ group :production do
13
+ gem 'dm-mysql-adapter', ['~> 1.0.0', '< 1.0.3']
14
+ gem 'dm-postgres-adapter', ['<= 1.0.0']
15
+ end
@@ -0,0 +1,30 @@
1
+ source :rubygems
2
+ source 'http://rubygems.org/gems'
3
+
4
+ path "../projects"
5
+
6
+ platforms :mri do
7
+ gem 'rspec'
8
+ end
9
+
10
+ platforms :ruby do
11
+ gem 'dm-core'
12
+ end
13
+
14
+ platforms :jruby do
15
+ gem 'ixtlan-core'
16
+ end
17
+
18
+ platforms :mswin do
19
+ gem 'ixtlan-error-handler'
20
+ end
21
+
22
+ git "git://github.com/rails/rails.git" do
23
+ gem "activesupport"
24
+ gem "actionpack"
25
+ end
26
+
27
+ path "../projects" do
28
+ gem "wirble"
29
+ gem "faker"
30
+ end
@@ -0,0 +1,8 @@
1
+ gem 'ixtlan-core'
2
+ gem 'dm-sqlite-adapter', '~> 1.0.0'
3
+
4
+
5
+ group :production do
6
+ gem 'dm-mysql-adapter', ['~> 1.0.0', '< 1.0.3']
7
+ gem 'dm-postgres-adapter', ['<= 1.0.0']
8
+ end
@@ -0,0 +1,53 @@
1
+ GEM
2
+ specs:
3
+ addressable (2.2.4)
4
+ data_objects (0.10.3)
5
+ addressable (~> 2.1)
6
+ dm-core (1.0.2)
7
+ addressable (~> 2.2)
8
+ extlib (~> 0.9.15)
9
+ dm-do-adapter (1.0.2)
10
+ data_objects (~> 0.10.2)
11
+ dm-core (~> 1.0.2)
12
+ dm-mysql-adapter (1.0.2)
13
+ dm-do-adapter (~> 1.0.2)
14
+ do_mysql (~> 0.10.2)
15
+ dm-postgres-adapter (1.0.0)
16
+ dm-do-adapter (~> 1.0.0)
17
+ do_postgres (~> 0.10.2)
18
+ dm-sqlite-adapter (1.0.2)
19
+ dm-do-adapter (~> 1.0.2)
20
+ do_sqlite3 (~> 0.10.2)
21
+ do_jdbc (0.10.3-java)
22
+ data_objects (= 0.10.3)
23
+ do_mysql (0.10.3-java)
24
+ data_objects (= 0.10.3)
25
+ do_jdbc (= 0.10.3)
26
+ jdbc-mysql (>= 5.0.4)
27
+ do_postgres (0.10.3-java)
28
+ data_objects (= 0.10.3)
29
+ do_jdbc (= 0.10.3)
30
+ jdbc-postgres (>= 8.2)
31
+ do_sqlite3 (0.10.3-java)
32
+ data_objects (= 0.10.3)
33
+ do_jdbc (= 0.10.3)
34
+ jdbc-sqlite3 (>= 3.5.8)
35
+ extlib (0.9.15)
36
+ ixtlan-core (0.1.1)
37
+ slf4r (= 0.4.2)
38
+ jdbc-mysql (5.0.4)
39
+ jdbc-postgres (8.4.702-java)
40
+ jdbc-sqlite3 (3.6.14.2.056-java)
41
+ slf4r (0.4.2)
42
+
43
+ PLATFORMS
44
+ java
45
+
46
+ DEPENDENCIES
47
+ dm-core
48
+ dm-mysql-adapter (~> 1.0.0, < 1.0.3)
49
+ dm-postgres-adapter (<= 1.0.0)
50
+ dm-sqlite-adapter (~> 1.0.0)
51
+ ixtlan-core
52
+ ixtlan-error-handler
53
+ rspec
@@ -0,0 +1 @@
1
+ gemspec "minimal.gemspec"
@@ -0,0 +1 @@
1
+ gemspec "maven-tools.gemspec"
@@ -0,0 +1,16 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.1'
4
+
5
+ gem 'sqlite3', :group => :development unless defined?(JRUBY_VERSION)
6
+ gem "activerecord-jdbc-adapter" if defined?(JRUBY_VERSION)
7
+ gem "jdbc-sqlite3", :group => :development , :require => false if defined?(JRUBY_VERSION)
8
+
9
+ group :development, :test do
10
+ gem 'rspec'
11
+ end
12
+
13
+ group :production do
14
+ gem 'mysql' unless defined?(JRUBY_VERSION)
15
+ gem "jdbc-mysql", :require => false if defined?(JRUBY_VERSION)
16
+ end
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.1'
4
+
5
+ gem 'sqlite3' unless defined?(JRUBY_VERSION)
6
+ gem "activerecord-jdbc-adapter" if defined?(JRUBY_VERSION)
7
+ gem "jdbc-sqlite3", :require => false if defined?(JRUBY_VERSION)
@@ -0,0 +1 @@
1
+ gemspec "maven-tools.gemspec"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ maven-tools (0.32.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.1.3)
10
+ minitest (4.4.0)
11
+ rake (10.0.3)
12
+ rspec (2.7.0)
13
+ rspec-core (~> 2.7.0)
14
+ rspec-expectations (~> 2.7.0)
15
+ rspec-mocks (~> 2.7.0)
16
+ rspec-core (2.7.1)
17
+ rspec-expectations (2.7.0)
18
+ diff-lcs (~> 1.1.2)
19
+ rspec-mocks (2.7.0)
20
+
21
+ PLATFORMS
22
+ java
23
+
24
+ DEPENDENCIES
25
+ maven-tools!
26
+ minitest (~> 4.4)
27
+ rake (~> 10.0.3)
28
+ rspec (= 2.7)
@@ -0,0 +1,2 @@
1
+ jar 'org.slf4j:slf4j-simple', '>= 1.5.6'
2
+ pom 'org.slf4j:slf4j-default'
@@ -0,0 +1 @@
1
+ org.slf4j:slf4j-simple:jar:1.5.6
@@ -0,0 +1,2 @@
1
+ jar 'org.slf4j:slf4j-simple', '>= 1.5.6'
2
+ pom 'org.slf4j:slf4j-default'
@@ -0,0 +1,8 @@
1
+ #-*- mode: ruby -*-
2
+ Gem::Specification.new do |s|
3
+ s.name = 'deps'
4
+ s.version = '1.0.0'
5
+ s.add_dependency 'slf4r', '>0.4.0'
6
+ s.add_development_dependency 'rspec', '~>2.4.0'
7
+ s.add_development_dependency 'cucumber', ['>= 0.10.0', "< 0.11.1"]
8
+ end
@@ -0,0 +1,1127 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper.rb'))
2
+ require 'maven/tools/gem_project'
3
+
4
+ describe Maven::Tools::GemProject do
5
+
6
+ before :each do
7
+ @project = Maven::Tools::GemProject.new("test")
8
+ end
9
+
10
+ it 'should setup an empty gem project' do
11
+ @project.to_xml.should == <<-XML
12
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13
+ <modelVersion>4.0.0</modelVersion>
14
+ <groupId>rubygems</groupId>
15
+ <artifactId>test</artifactId>
16
+ <version>0.0.0</version>
17
+ <packaging>gem</packaging>
18
+ </project>
19
+ XML
20
+ end
21
+
22
+ describe "Jarfile" do
23
+
24
+ it 'should load Jarfile without lockfile' do
25
+ @project.load_jarfile(File.join(File.dirname(__FILE__), 'Jarfile.without'))
26
+ @project.to_xml.should == <<-XML
27
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
28
+ <modelVersion>4.0.0</modelVersion>
29
+ <groupId>rubygems</groupId>
30
+ <artifactId>test</artifactId>
31
+ <version>0.0.0</version>
32
+ <packaging>gem</packaging>
33
+ <dependencies>
34
+ <dependency>
35
+ <groupId>org.slf4j</groupId>
36
+ <artifactId>slf4j-simple</artifactId>
37
+ <version>[1.5.6,)</version>
38
+ <type>jar</type>
39
+ </dependency>
40
+ <dependency>
41
+ <groupId>org.slf4j</groupId>
42
+ <artifactId>slf4j-default</artifactId>
43
+ <version>[0,)</version>
44
+ <type>pom</type>
45
+ </dependency>
46
+ </dependencies>
47
+ </project>
48
+ XML
49
+ end
50
+
51
+ it 'should load Jarfile with lockfile' do
52
+ @project.load_jarfile(File.join(File.dirname(__FILE__), 'Jarfile.with'))
53
+ @project.to_xml.should == <<-XML
54
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
+ <modelVersion>4.0.0</modelVersion>
56
+ <groupId>rubygems</groupId>
57
+ <artifactId>test</artifactId>
58
+ <version>0.0.0</version>
59
+ <packaging>gem</packaging>
60
+ <dependencies>
61
+ <dependency>
62
+ <groupId>org.slf4j</groupId>
63
+ <artifactId>slf4j-simple</artifactId>
64
+ <version>1.5.6</version>
65
+ <type>jar</type>
66
+ </dependency>
67
+ </dependencies>
68
+ </project>
69
+ XML
70
+ end
71
+ end
72
+
73
+ describe "Gemfile" do
74
+
75
+ it 'should load Gemfile with minimal gemspec' do
76
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.minimal'))
77
+ @project.to_xml.should == <<-XML
78
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
79
+ <modelVersion>4.0.0</modelVersion>
80
+ <groupId>rubygems</groupId>
81
+ <artifactId>minimal</artifactId>
82
+ <version>1.0.0</version>
83
+ <name><![CDATA[minimal - gem]]></name>
84
+ <packaging>gem</packaging>
85
+ <build>
86
+ <plugins>
87
+ <plugin>
88
+ <groupId>de.saumya.mojo</groupId>
89
+ <artifactId>bundler-maven-plugin</artifactId>
90
+ </plugin>
91
+ <plugin>
92
+ <groupId>de.saumya.mojo</groupId>
93
+ <artifactId>gem-maven-plugin</artifactId>
94
+ <configuration>
95
+ <gemspec>rspec/maven/tools/minimal.gemspec</gemspec>
96
+ </configuration>
97
+ </plugin>
98
+ </plugins>
99
+ </build>
100
+ </project>
101
+ XML
102
+ end
103
+
104
+ it 'should load Gemfile with gemspec but no Gemfile.lock' do
105
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.nolock'))
106
+ @project.to_xml.should == <<-XML
107
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
108
+ <modelVersion>4.0.0</modelVersion>
109
+ <groupId>rubygems</groupId>
110
+ <artifactId>maven-tools</artifactId>
111
+ <version>0.32.0</version>
112
+ <name><![CDATA[helpers for maven related tasks]]></name>
113
+ <packaging>gem</packaging>
114
+ <description><![CDATA[adds versions conversion from rubygems to maven and vice versa, ruby DSL for POM (Project Object Model from maven), pom generators, etc]]></description>
115
+ <url>http://github.com/torquebox/maven-tools</url>
116
+ <developers>
117
+ <developer>
118
+ <id>m_dot_kristian_at_web_dot_de</id>
119
+ <name>Christian Meier</name>
120
+ <email>m.kristian@web.de</email>
121
+ </developer>
122
+ </developers>
123
+ <dependencies>
124
+ <dependency>
125
+ <groupId>rubygems</groupId>
126
+ <artifactId>rake</artifactId>
127
+ <version>[10.0.3,10.0.99999]</version>
128
+ <type>gem</type>
129
+ <scope>test</scope>
130
+ </dependency>
131
+ <dependency>
132
+ <groupId>rubygems</groupId>
133
+ <artifactId>minitest</artifactId>
134
+ <version>[4.4,4.99999]</version>
135
+ <type>gem</type>
136
+ <scope>test</scope>
137
+ </dependency>
138
+ <dependency>
139
+ <groupId>rubygems</groupId>
140
+ <artifactId>rspec</artifactId>
141
+ <version>[2.7,2.7.0.0.0.0.1)</version>
142
+ <type>gem</type>
143
+ <scope>test</scope>
144
+ </dependency>
145
+ </dependencies>
146
+ <build>
147
+ <plugins>
148
+ <plugin>
149
+ <groupId>de.saumya.mojo</groupId>
150
+ <artifactId>bundler-maven-plugin</artifactId>
151
+ </plugin>
152
+ <plugin>
153
+ <groupId>de.saumya.mojo</groupId>
154
+ <artifactId>gem-maven-plugin</artifactId>
155
+ <configuration>
156
+ <gemspec>rspec/maven/tools/maven-tools.gemspec</gemspec>
157
+ </configuration>
158
+ </plugin>
159
+ </plugins>
160
+ </build>
161
+ </project>
162
+ XML
163
+ end
164
+
165
+ it 'should load Gemfile with gemspec but with Gemfile.lock' do
166
+ pending "hash is differently orderd in ruby1.8" if RUBY_VERSION =~ /^1.8/ && !defined? JRUBY_VERSION
167
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.withlock'))
168
+ @project.to_xml.should == <<-XML
169
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
170
+ <modelVersion>4.0.0</modelVersion>
171
+ <groupId>rubygems</groupId>
172
+ <artifactId>maven-tools</artifactId>
173
+ <version>0.32.0</version>
174
+ <name><![CDATA[helpers for maven related tasks]]></name>
175
+ <packaging>gem</packaging>
176
+ <description><![CDATA[adds versions conversion from rubygems to maven and vice versa, ruby DSL for POM (Project Object Model from maven), pom generators, etc]]></description>
177
+ <url>http://github.com/torquebox/maven-tools</url>
178
+ <developers>
179
+ <developer>
180
+ <id>m_dot_kristian_at_web_dot_de</id>
181
+ <name>Christian Meier</name>
182
+ <email>m.kristian@web.de</email>
183
+ </developer>
184
+ </developers>
185
+ <dependencies>
186
+ <dependency>
187
+ <groupId>rubygems</groupId>
188
+ <artifactId>rake</artifactId>
189
+ <type>gem</type>
190
+ <scope>test</scope>
191
+ </dependency>
192
+ <dependency>
193
+ <groupId>rubygems</groupId>
194
+ <artifactId>minitest</artifactId>
195
+ <type>gem</type>
196
+ <scope>test</scope>
197
+ </dependency>
198
+ <dependency>
199
+ <groupId>rubygems</groupId>
200
+ <artifactId>rspec</artifactId>
201
+ <type>gem</type>
202
+ <scope>test</scope>
203
+ </dependency>
204
+ <dependency>
205
+ <groupId>rubygems</groupId>
206
+ <artifactId>rspec-core</artifactId>
207
+ <type>gem</type>
208
+ <scope>test</scope>
209
+ </dependency>
210
+ <dependency>
211
+ <groupId>rubygems</groupId>
212
+ <artifactId>rspec-expectations</artifactId>
213
+ <type>gem</type>
214
+ <scope>test</scope>
215
+ </dependency>
216
+ <dependency>
217
+ <groupId>rubygems</groupId>
218
+ <artifactId>diff-lcs</artifactId>
219
+ <type>gem</type>
220
+ <scope>test</scope>
221
+ </dependency>
222
+ <dependency>
223
+ <groupId>rubygems</groupId>
224
+ <artifactId>rspec-mocks</artifactId>
225
+ <type>gem</type>
226
+ <scope>test</scope>
227
+ </dependency>
228
+ </dependencies>
229
+ <dependencyManagement>
230
+ <dependencies>
231
+ <dependency>
232
+ <groupId>rubygems</groupId>
233
+ <artifactId>maven-tools</artifactId>
234
+ <version>0.32.0</version>
235
+ <type>gem</type>
236
+ </dependency>
237
+ <dependency>
238
+ <groupId>rubygems</groupId>
239
+ <artifactId>diff-lcs</artifactId>
240
+ <version>1.1.3</version>
241
+ <type>gem</type>
242
+ </dependency>
243
+ <dependency>
244
+ <groupId>rubygems</groupId>
245
+ <artifactId>minitest</artifactId>
246
+ <version>4.4.0</version>
247
+ <type>gem</type>
248
+ </dependency>
249
+ <dependency>
250
+ <groupId>rubygems</groupId>
251
+ <artifactId>rake</artifactId>
252
+ <version>10.0.3</version>
253
+ <type>gem</type>
254
+ </dependency>
255
+ <dependency>
256
+ <groupId>rubygems</groupId>
257
+ <artifactId>rspec</artifactId>
258
+ <version>2.7.0</version>
259
+ <type>gem</type>
260
+ </dependency>
261
+ <dependency>
262
+ <groupId>rubygems</groupId>
263
+ <artifactId>rspec-core</artifactId>
264
+ <version>2.7.1</version>
265
+ <type>gem</type>
266
+ </dependency>
267
+ <dependency>
268
+ <groupId>rubygems</groupId>
269
+ <artifactId>rspec-expectations</artifactId>
270
+ <version>2.7.0</version>
271
+ <type>gem</type>
272
+ </dependency>
273
+ <dependency>
274
+ <groupId>rubygems</groupId>
275
+ <artifactId>rspec-mocks</artifactId>
276
+ <version>2.7.0</version>
277
+ <type>gem</type>
278
+ </dependency>
279
+ </dependencies>
280
+ </dependencyManagement>
281
+ <build>
282
+ <plugins>
283
+ <plugin>
284
+ <groupId>de.saumya.mojo</groupId>
285
+ <artifactId>bundler-maven-plugin</artifactId>
286
+ </plugin>
287
+ <plugin>
288
+ <groupId>de.saumya.mojo</groupId>
289
+ <artifactId>gem-maven-plugin</artifactId>
290
+ <configuration>
291
+ <gemspec>rspec/maven/tools/maven-tools.gemspec</gemspec>
292
+ </configuration>
293
+ </plugin>
294
+ </plugins>
295
+ </build>
296
+ </project>
297
+ XML
298
+ end
299
+
300
+ it 'should load Gemfile with "source", "path" and "platform"' do
301
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.ignored'))
302
+ @project.to_xml.should == <<-XML
303
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
304
+ <modelVersion>4.0.0</modelVersion>
305
+ <groupId>rubygems</groupId>
306
+ <artifactId>test</artifactId>
307
+ <version>0.0.0</version>
308
+ <packaging>gem</packaging>
309
+ <dependencies>
310
+ <dependency>
311
+ <groupId>rubygems</groupId>
312
+ <artifactId>ixtlan-core</artifactId>
313
+ <version>[0,)</version>
314
+ <type>gem</type>
315
+ </dependency>
316
+ </dependencies>
317
+ <build>
318
+ <plugins>
319
+ <plugin>
320
+ <groupId>de.saumya.mojo</groupId>
321
+ <artifactId>bundler-maven-plugin</artifactId>
322
+ </plugin>
323
+ </plugins>
324
+ </build>
325
+ </project>
326
+ XML
327
+ end
328
+
329
+ it 'should load Gemfile with simple gems"' do
330
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.gems'))
331
+ @project.to_xml.should == <<-XML
332
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
333
+ <modelVersion>4.0.0</modelVersion>
334
+ <groupId>rubygems</groupId>
335
+ <artifactId>test</artifactId>
336
+ <version>0.0.0</version>
337
+ <packaging>gem</packaging>
338
+ <dependencies>
339
+ <dependency>
340
+ <groupId>rubygems</groupId>
341
+ <artifactId>ixtlan-core</artifactId>
342
+ <version>[0,)</version>
343
+ <type>gem</type>
344
+ </dependency>
345
+ </dependencies>
346
+ <build>
347
+ <plugins>
348
+ <plugin>
349
+ <groupId>de.saumya.mojo</groupId>
350
+ <artifactId>bundler-maven-plugin</artifactId>
351
+ </plugin>
352
+ </plugins>
353
+ </build>
354
+ <profiles>
355
+ <profile>
356
+ <id>development</id>
357
+ <dependencies>
358
+ <dependency>
359
+ <groupId>rubygems</groupId>
360
+ <artifactId>dm-mysql-adapter</artifactId>
361
+ <version>[0.10.0,0.10.3)</version>
362
+ <type>gem</type>
363
+ </dependency>
364
+ <dependency>
365
+ <groupId>rubygems</groupId>
366
+ <artifactId>dm-hsqldb-adapter</artifactId>
367
+ <version>[0.10.0,0.10.0.0.0.0.0.1)</version>
368
+ <type>gem</type>
369
+ </dependency>
370
+ </dependencies>
371
+ </profile>
372
+ <profile>
373
+ <id>production</id>
374
+ <dependencies>
375
+ <dependency>
376
+ <groupId>rubygems</groupId>
377
+ <artifactId>dm-mysql-adapter</artifactId>
378
+ <version>[0.10.0,0.10.3)</version>
379
+ <type>gem</type>
380
+ </dependency>
381
+ </dependencies>
382
+ </profile>
383
+ <profile>
384
+ <id>test</id>
385
+ <dependencies>
386
+ <dependency>
387
+ <groupId>rubygems</groupId>
388
+ <artifactId>dm-sqlite3-adapter</artifactId>
389
+ <version>[0.10.0,0.10.99999]</version>
390
+ <type>gem</type>
391
+ </dependency>
392
+ </dependencies>
393
+ </profile>
394
+ </profiles>
395
+ </project>
396
+ XML
397
+ end
398
+
399
+ it 'should load Gemfile with grouped gems and added defaults"' do
400
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.groups'))
401
+ @project.name "test"
402
+ @project.add_defaults
403
+ @project.to_xml.should == <<-XML
404
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
405
+ <modelVersion>4.0.0</modelVersion>
406
+ <groupId>rubygems</groupId>
407
+ <artifactId>test</artifactId>
408
+ <version>0.0.0</version>
409
+ <name><![CDATA[test]]></name>
410
+ <packaging>gem</packaging>
411
+ <repositories>
412
+ <repository>
413
+ <id>rubygems-releases</id>
414
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
415
+ </repository>
416
+ </repositories>
417
+ <pluginRepositories>
418
+ <pluginRepository>
419
+ <id>rubygems-releases</id>
420
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
421
+ </pluginRepository>
422
+ </pluginRepositories>
423
+ <dependencies>
424
+ <dependency>
425
+ <groupId>rubygems</groupId>
426
+ <artifactId>bundler</artifactId>
427
+ <type>gem</type>
428
+ <scope>test</scope>
429
+ </dependency>
430
+ </dependencies>
431
+ <dependencyManagement>
432
+ <dependencies>
433
+ <dependency>
434
+ <groupId>rubygems</groupId>
435
+ <artifactId>bundler</artifactId>
436
+ <version>_bundler.version_</version>
437
+ <type>gem</type>
438
+ </dependency>
439
+ </dependencies>
440
+ </dependencyManagement>
441
+ <properties>
442
+ <gem.home>${project.build.directory}/rubygems</gem.home>
443
+ <gem.path>${project.build.directory}/rubygems</gem.path>
444
+ <jruby.plugins.version>_project.version_</jruby.plugins.version>
445
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
446
+ </properties>
447
+ <build>
448
+ <plugins>
449
+ <plugin>
450
+ <groupId>de.saumya.mojo</groupId>
451
+ <artifactId>bundler-maven-plugin</artifactId>
452
+ <version>${jruby.plugins.version}</version>
453
+ <executions>
454
+ <execution>
455
+ <goals>
456
+ <goal>install</goal>
457
+ </goals>
458
+ </execution>
459
+ </executions>
460
+ <dependencies>
461
+ <dependency>
462
+ <groupId>rubygems</groupId>
463
+ <artifactId>ixtlan-core</artifactId>
464
+ <version>[0,)</version>
465
+ <type>gem</type>
466
+ </dependency>
467
+ <dependency>
468
+ <groupId>rubygems</groupId>
469
+ <artifactId>dm-sqlite-adapter</artifactId>
470
+ <version>[1.0.0,1.0.99999]</version>
471
+ <type>gem</type>
472
+ </dependency>
473
+ <dependency>
474
+ <groupId>rubygems</groupId>
475
+ <artifactId>dm-mysql-adapter</artifactId>
476
+ <version>[1.0.0,1.0.3)</version>
477
+ <type>gem</type>
478
+ </dependency>
479
+ <dependency>
480
+ <groupId>rubygems</groupId>
481
+ <artifactId>dm-postgres-adapter</artifactId>
482
+ <version>[0,1.0.0]</version>
483
+ <type>gem</type>
484
+ </dependency>
485
+ </dependencies>
486
+ </plugin>
487
+ <plugin>
488
+ <groupId>de.saumya.mojo</groupId>
489
+ <artifactId>gem-maven-plugin</artifactId>
490
+ <version>${jruby.plugins.version}</version>
491
+ <extensions>true</extensions>
492
+ </plugin>
493
+ </plugins>
494
+ <pluginManagement>
495
+ <plugins>
496
+ <plugin>
497
+ <groupId>org.eclipse.m2e</groupId>
498
+ <artifactId>lifecycle-mapping</artifactId>
499
+ <version>1.0.0</version>
500
+ <configuration>
501
+ <lifecycleMappingMetadata>
502
+ <pluginExecutions>
503
+ <pluginExecution>
504
+ <action>
505
+ <ignore></ignore>
506
+ </action>
507
+ <pluginExecutionFilter>
508
+ <artifactId>bundler-maven-plugin</artifactId>
509
+ <goals>
510
+ <goal>install</goal>
511
+ </goals>
512
+ <groupId>de.saumya.mojo</groupId>
513
+ <versionRange>[0,)</versionRange>
514
+ </pluginExecutionFilter>
515
+ </pluginExecution>
516
+ <pluginExecution>
517
+ <action>
518
+ <ignore></ignore>
519
+ </action>
520
+ <pluginExecutionFilter>
521
+ <artifactId>gem-maven-plugin</artifactId>
522
+ <goals>
523
+ <goal>initialize</goal>
524
+ </goals>
525
+ <groupId>de.saumya.mojo</groupId>
526
+ <versionRange>[0,)</versionRange>
527
+ </pluginExecutionFilter>
528
+ </pluginExecution>
529
+ </pluginExecutions>
530
+ </lifecycleMappingMetadata>
531
+ </configuration>
532
+ </plugin>
533
+ </plugins>
534
+ </pluginManagement>
535
+ </build>
536
+ <profiles>
537
+ <profile>
538
+ <id>development</id>
539
+ <dependencies>
540
+ <dependency>
541
+ <groupId>rubygems</groupId>
542
+ <artifactId>dm-sqlite-adapter</artifactId>
543
+ <version>[1.0.0,1.0.99999]</version>
544
+ <type>gem</type>
545
+ </dependency>
546
+ </dependencies>
547
+ </profile>
548
+ <profile>
549
+ <id>executable</id>
550
+ <dependencies>
551
+ <dependency>
552
+ <groupId>de.saumya.mojo</groupId>
553
+ <artifactId>gem-assembly-descriptors</artifactId>
554
+ <version>${jruby.plugins.version}</version>
555
+ <type>jar</type>
556
+ <scope>runtime</scope>
557
+ </dependency>
558
+ </dependencies>
559
+ <build>
560
+ <plugins>
561
+ <plugin>
562
+ <artifactId>maven-assembly-plugin</artifactId>
563
+ <version>_assembly.version_</version>
564
+ <configuration>
565
+ <archive>
566
+ <manifest>
567
+ <mainClass>de.saumya.mojo.assembly.Main</mainClass>
568
+ </manifest>
569
+ </archive>
570
+ <descriptorRefs>
571
+ <descriptorRef>jar-with-dependencies-and-gems</descriptorRef>
572
+ </descriptorRefs>
573
+ </configuration>
574
+ <executions>
575
+ <execution>
576
+ <id>in_phase_package</id>
577
+ <phase>package</phase>
578
+ <goals>
579
+ <goal>assembly</goal>
580
+ </goals>
581
+ </execution>
582
+ </executions>
583
+ <dependencies>
584
+ <dependency>
585
+ <groupId>de.saumya.mojo</groupId>
586
+ <artifactId>gem-assembly-descriptors</artifactId>
587
+ <version>${jruby.plugins.version}</version>
588
+ <type>jar</type>
589
+ </dependency>
590
+ </dependencies>
591
+ </plugin>
592
+ </plugins>
593
+ </build>
594
+ </profile>
595
+ <profile>
596
+ <id>production</id>
597
+ <dependencies>
598
+ <dependency>
599
+ <groupId>rubygems</groupId>
600
+ <artifactId>ixtlan-core</artifactId>
601
+ <version>[0,)</version>
602
+ <type>gem</type>
603
+ </dependency>
604
+ <dependency>
605
+ <groupId>rubygems</groupId>
606
+ <artifactId>dm-mysql-adapter</artifactId>
607
+ <version>[1.0.0,1.0.3)</version>
608
+ <type>gem</type>
609
+ </dependency>
610
+ <dependency>
611
+ <groupId>rubygems</groupId>
612
+ <artifactId>dm-postgres-adapter</artifactId>
613
+ <version>[0,1.0.0]</version>
614
+ <type>gem</type>
615
+ </dependency>
616
+ </dependencies>
617
+ </profile>
618
+ <profile>
619
+ <id>test</id>
620
+ <dependencies>
621
+ <dependency>
622
+ <groupId>rubygems</groupId>
623
+ <artifactId>ixtlan-core</artifactId>
624
+ <version>[0,)</version>
625
+ <type>gem</type>
626
+ </dependency>
627
+ </dependencies>
628
+ </profile>
629
+ </profiles>
630
+ </project>
631
+ XML
632
+ end
633
+
634
+ it 'should load Gemfile with grouped gems and lock file"' do
635
+ pending "hash is differently orderd in ruby1.8" if RUBY_VERSION =~ /^1.8/ && !defined? JRUBY_VERSION
636
+ @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.lockfile'))
637
+ @project.name "test"
638
+ @project.to_xml.should == <<-XML
639
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
640
+ <modelVersion>4.0.0</modelVersion>
641
+ <groupId>rubygems</groupId>
642
+ <artifactId>test</artifactId>
643
+ <version>0.0.0</version>
644
+ <name><![CDATA[test]]></name>
645
+ <packaging>gem</packaging>
646
+ <dependencies>
647
+ <dependency>
648
+ <groupId>rubygems</groupId>
649
+ <artifactId>ixtlan-core</artifactId>
650
+ <type>gem</type>
651
+ </dependency>
652
+ <dependency>
653
+ <groupId>rubygems</groupId>
654
+ <artifactId>slf4r</artifactId>
655
+ <type>gem</type>
656
+ </dependency>
657
+ <dependency>
658
+ <groupId>rubygems</groupId>
659
+ <artifactId>dm-sqlite-adapter</artifactId>
660
+ <type>gem</type>
661
+ </dependency>
662
+ <dependency>
663
+ <groupId>rubygems</groupId>
664
+ <artifactId>dm-do-adapter</artifactId>
665
+ <type>gem</type>
666
+ </dependency>
667
+ <dependency>
668
+ <groupId>rubygems</groupId>
669
+ <artifactId>data_objects</artifactId>
670
+ <type>gem</type>
671
+ </dependency>
672
+ <dependency>
673
+ <groupId>rubygems</groupId>
674
+ <artifactId>addressable</artifactId>
675
+ <type>gem</type>
676
+ </dependency>
677
+ <dependency>
678
+ <groupId>rubygems</groupId>
679
+ <artifactId>dm-core</artifactId>
680
+ <type>gem</type>
681
+ </dependency>
682
+ <dependency>
683
+ <groupId>rubygems</groupId>
684
+ <artifactId>extlib</artifactId>
685
+ <type>gem</type>
686
+ </dependency>
687
+ <dependency>
688
+ <groupId>rubygems</groupId>
689
+ <artifactId>do_sqlite3</artifactId>
690
+ <type>gem</type>
691
+ </dependency>
692
+ <dependency>
693
+ <groupId>rubygems</groupId>
694
+ <artifactId>do_jdbc</artifactId>
695
+ <type>gem</type>
696
+ </dependency>
697
+ <dependency>
698
+ <groupId>rubygems</groupId>
699
+ <artifactId>jdbc-sqlite3</artifactId>
700
+ <type>gem</type>
701
+ </dependency>
702
+ </dependencies>
703
+ <dependencyManagement>
704
+ <dependencies>
705
+ <dependency>
706
+ <groupId>rubygems</groupId>
707
+ <artifactId>addressable</artifactId>
708
+ <version>2.2.4</version>
709
+ <type>gem</type>
710
+ </dependency>
711
+ <dependency>
712
+ <groupId>rubygems</groupId>
713
+ <artifactId>data_objects</artifactId>
714
+ <version>0.10.3</version>
715
+ <type>gem</type>
716
+ </dependency>
717
+ <dependency>
718
+ <groupId>rubygems</groupId>
719
+ <artifactId>dm-core</artifactId>
720
+ <version>1.0.2</version>
721
+ <type>gem</type>
722
+ </dependency>
723
+ <dependency>
724
+ <groupId>rubygems</groupId>
725
+ <artifactId>extlib</artifactId>
726
+ <version>0.9.15</version>
727
+ <type>gem</type>
728
+ </dependency>
729
+ <dependency>
730
+ <groupId>rubygems</groupId>
731
+ <artifactId>dm-do-adapter</artifactId>
732
+ <version>1.0.2</version>
733
+ <type>gem</type>
734
+ </dependency>
735
+ <dependency>
736
+ <groupId>rubygems</groupId>
737
+ <artifactId>dm-mysql-adapter</artifactId>
738
+ <version>1.0.2</version>
739
+ <type>gem</type>
740
+ </dependency>
741
+ <dependency>
742
+ <groupId>rubygems</groupId>
743
+ <artifactId>do_mysql</artifactId>
744
+ <version>0.10.3</version>
745
+ <type>gem</type>
746
+ </dependency>
747
+ <dependency>
748
+ <groupId>rubygems</groupId>
749
+ <artifactId>do_jdbc</artifactId>
750
+ <version>0.10.3</version>
751
+ <type>gem</type>
752
+ </dependency>
753
+ <dependency>
754
+ <groupId>rubygems</groupId>
755
+ <artifactId>jdbc-mysql</artifactId>
756
+ <version>5.0.4</version>
757
+ <type>gem</type>
758
+ </dependency>
759
+ <dependency>
760
+ <groupId>rubygems</groupId>
761
+ <artifactId>dm-postgres-adapter</artifactId>
762
+ <version>1.0.0</version>
763
+ <type>gem</type>
764
+ </dependency>
765
+ <dependency>
766
+ <groupId>rubygems</groupId>
767
+ <artifactId>do_postgres</artifactId>
768
+ <version>0.10.3</version>
769
+ <type>gem</type>
770
+ </dependency>
771
+ <dependency>
772
+ <groupId>rubygems</groupId>
773
+ <artifactId>jdbc-postgres</artifactId>
774
+ <version>8.4.702</version>
775
+ <type>gem</type>
776
+ </dependency>
777
+ <dependency>
778
+ <groupId>rubygems</groupId>
779
+ <artifactId>dm-sqlite-adapter</artifactId>
780
+ <version>1.0.2</version>
781
+ <type>gem</type>
782
+ </dependency>
783
+ <dependency>
784
+ <groupId>rubygems</groupId>
785
+ <artifactId>do_sqlite3</artifactId>
786
+ <version>0.10.3</version>
787
+ <type>gem</type>
788
+ </dependency>
789
+ <dependency>
790
+ <groupId>rubygems</groupId>
791
+ <artifactId>jdbc-sqlite3</artifactId>
792
+ <version>3.6.14.2.056</version>
793
+ <type>gem</type>
794
+ </dependency>
795
+ <dependency>
796
+ <groupId>rubygems</groupId>
797
+ <artifactId>ixtlan-core</artifactId>
798
+ <version>0.1.1</version>
799
+ <type>gem</type>
800
+ </dependency>
801
+ <dependency>
802
+ <groupId>rubygems</groupId>
803
+ <artifactId>slf4r</artifactId>
804
+ <version>0.4.2</version>
805
+ <type>gem</type>
806
+ </dependency>
807
+ </dependencies>
808
+ </dependencyManagement>
809
+ <build>
810
+ <plugins>
811
+ <plugin>
812
+ <groupId>de.saumya.mojo</groupId>
813
+ <artifactId>bundler-maven-plugin</artifactId>
814
+ </plugin>
815
+ </plugins>
816
+ </build>
817
+ <profiles>
818
+ <profile>
819
+ <id>production</id>
820
+ <dependencies>
821
+ <dependency>
822
+ <groupId>rubygems</groupId>
823
+ <artifactId>dm-mysql-adapter</artifactId>
824
+ <type>gem</type>
825
+ </dependency>
826
+ <dependency>
827
+ <groupId>rubygems</groupId>
828
+ <artifactId>do_mysql</artifactId>
829
+ <type>gem</type>
830
+ </dependency>
831
+ <dependency>
832
+ <groupId>rubygems</groupId>
833
+ <artifactId>jdbc-mysql</artifactId>
834
+ <type>gem</type>
835
+ </dependency>
836
+ <dependency>
837
+ <groupId>rubygems</groupId>
838
+ <artifactId>dm-postgres-adapter</artifactId>
839
+ <type>gem</type>
840
+ </dependency>
841
+ <dependency>
842
+ <groupId>rubygems</groupId>
843
+ <artifactId>do_postgres</artifactId>
844
+ <type>gem</type>
845
+ </dependency>
846
+ <dependency>
847
+ <groupId>rubygems</groupId>
848
+ <artifactId>jdbc-postgres</artifactId>
849
+ <type>gem</type>
850
+ </dependency>
851
+ </dependencies>
852
+ </profile>
853
+ </profiles>
854
+ </project>
855
+ XML
856
+ end
857
+ end
858
+
859
+ describe "gemspec" do
860
+
861
+ it 'should load minimal gemspec' do
862
+ @project.load_gemspec(File.join(File.dirname(__FILE__), 'minimal.gemspec'))
863
+ @project.to_xml.should == <<-XML
864
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
865
+ <modelVersion>4.0.0</modelVersion>
866
+ <groupId>rubygems</groupId>
867
+ <artifactId>minimal</artifactId>
868
+ <version>1.0.0</version>
869
+ <name><![CDATA[minimal - gem]]></name>
870
+ <packaging>gem</packaging>
871
+ <build>
872
+ <plugins>
873
+ <plugin>
874
+ <groupId>de.saumya.mojo</groupId>
875
+ <artifactId>gem-maven-plugin</artifactId>
876
+ <configuration>
877
+ <gemspec>rspec/maven/tools/minimal.gemspec</gemspec>
878
+ </configuration>
879
+ </plugin>
880
+ </plugins>
881
+ </build>
882
+ </project>
883
+ XML
884
+ end
885
+
886
+ it 'should load gemspec without dependencies' do
887
+ @project.load_gemspec(File.join(File.dirname(__FILE__), 'no-deps.gemspec'))
888
+ @project.to_xml.should == <<-XML
889
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
890
+ <modelVersion>4.0.0</modelVersion>
891
+ <groupId>rubygems</groupId>
892
+ <artifactId>no-deps</artifactId>
893
+ <version>1.0.0</version>
894
+ <name><![CDATA[no dependencies project]]></name>
895
+ <packaging>gem</packaging>
896
+ <description><![CDATA[a no dependencies project to demonstrat how gemspec2pom works]]></description>
897
+ <url>http://example.com</url>
898
+ <developers>
899
+ <developer>
900
+ <id>Me_And_The_Corner</id>
901
+ <name>Me And The Corner</name>
902
+ </developer>
903
+ <developer>
904
+ <id>k_at_example_dot_com</id>
905
+ <name>Krysh Sample</name>
906
+ <email>k@example.com</email>
907
+ </developer>
908
+ </developers>
909
+ <licenses>
910
+ <license>
911
+ <name>AGPL</name>
912
+ <url>./AGPL.txt</url>
913
+ <distribution>repo</distribution>
914
+ </license>
915
+ </licenses>
916
+ <build>
917
+ <plugins>
918
+ <plugin>
919
+ <groupId>de.saumya.mojo</groupId>
920
+ <artifactId>gem-maven-plugin</artifactId>
921
+ <configuration>
922
+ <autorequire>my</autorequire>
923
+ <bindir>mybin</bindir>
924
+ <defaultExecutable>myexe</defaultExecutable>
925
+ <executables>hello</executables>
926
+ <extensions>myext</extensions>
927
+ <extraRdocFiles>README.txt</extraRdocFiles>
928
+ <files>AGPL.txt,README.txt,test/first_test.rb,mybin/hello,myext,lib/first.rb,spec/first_spec.rb,features/first.feature</files>
929
+ <gemspec>rspec/maven/tools/no-deps.gemspec</gemspec>
930
+ <platform>java</platform>
931
+ <postInstallMessage><![CDATA[be happy]]></postInstallMessage>
932
+ <rdocOptions>--main,README.txt</rdocOptions>
933
+ <requirePaths>mylib</requirePaths>
934
+ <requiredRubyVersion><![CDATA[= 1.8.7]]></requiredRubyVersion>
935
+ <requiredRubygemsVersion><![CDATA[= 1.4.2]]></requiredRubygemsVersion>
936
+ <requirements>installed java</requirements>
937
+ <rubyforgeProject>myproject</rubyforgeProject>
938
+ <testFiles>test/first_test.rb</testFiles>
939
+ </configuration>
940
+ </plugin>
941
+ </plugins>
942
+ </build>
943
+ </project>
944
+ XML
945
+ end
946
+
947
+ it 'should load gemspec with dependencies' do
948
+ @project.load_gemspec(File.join(File.dirname(__FILE__), 'deps.gemspec'))
949
+ @project.to_xml.should == <<-XML
950
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
951
+ <modelVersion>4.0.0</modelVersion>
952
+ <groupId>rubygems</groupId>
953
+ <artifactId>deps</artifactId>
954
+ <version>1.0.0</version>
955
+ <name><![CDATA[deps - gem]]></name>
956
+ <packaging>gem</packaging>
957
+ <dependencies>
958
+ <dependency>
959
+ <groupId>rubygems</groupId>
960
+ <artifactId>slf4r</artifactId>
961
+ <version>(0.4.0,)</version>
962
+ <type>gem</type>
963
+ <scope>compile</scope>
964
+ </dependency>
965
+ <dependency>
966
+ <groupId>rubygems</groupId>
967
+ <artifactId>rspec</artifactId>
968
+ <version>[2.4.0,2.4.99999]</version>
969
+ <type>gem</type>
970
+ <scope>test</scope>
971
+ </dependency>
972
+ <dependency>
973
+ <groupId>rubygems</groupId>
974
+ <artifactId>cucumber</artifactId>
975
+ <version>[0.10.0,0.11.1)</version>
976
+ <type>gem</type>
977
+ <scope>test</scope>
978
+ </dependency>
979
+ </dependencies>
980
+ <build>
981
+ <plugins>
982
+ <plugin>
983
+ <groupId>de.saumya.mojo</groupId>
984
+ <artifactId>gem-maven-plugin</artifactId>
985
+ <configuration>
986
+ <gemspec>rspec/maven/tools/deps.gemspec</gemspec>
987
+ </configuration>
988
+ </plugin>
989
+ </plugins>
990
+ </build>
991
+ </project>
992
+ XML
993
+ end
994
+
995
+ it 'should load minimal gemspec with applied defaults' do
996
+ @project.load_gemspec(File.join(File.dirname(__FILE__), 'minimal.gemspec'))
997
+ @project.add_defaults
998
+ @project.to_xml.should == <<-XML
999
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1000
+ <modelVersion>4.0.0</modelVersion>
1001
+ <groupId>rubygems</groupId>
1002
+ <artifactId>minimal</artifactId>
1003
+ <version>1.0.0</version>
1004
+ <name><![CDATA[minimal - gem]]></name>
1005
+ <packaging>gem</packaging>
1006
+ <repositories>
1007
+ <repository>
1008
+ <id>rubygems-releases</id>
1009
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
1010
+ </repository>
1011
+ </repositories>
1012
+ <pluginRepositories>
1013
+ <pluginRepository>
1014
+ <id>rubygems-releases</id>
1015
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
1016
+ </pluginRepository>
1017
+ </pluginRepositories>
1018
+ <properties>
1019
+ <gem.home>${project.build.directory}/rubygems</gem.home>
1020
+ <gem.path>${project.build.directory}/rubygems</gem.path>
1021
+ <jruby.plugins.version>_project.version_</jruby.plugins.version>
1022
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1023
+ </properties>
1024
+ <build>
1025
+ <plugins>
1026
+ <plugin>
1027
+ <groupId>de.saumya.mojo</groupId>
1028
+ <artifactId>gem-maven-plugin</artifactId>
1029
+ <version>${jruby.plugins.version}</version>
1030
+ <extensions>true</extensions>
1031
+ <configuration>
1032
+ <gemspec>rspec/maven/tools/minimal.gemspec</gemspec>
1033
+ </configuration>
1034
+ <dependencies>
1035
+ <dependency>
1036
+ <groupId>rubygems</groupId>
1037
+ <artifactId>jruby-openssl</artifactId>
1038
+ <version>[0,)</version>
1039
+ <type>gem</type>
1040
+ </dependency>
1041
+ </dependencies>
1042
+ </plugin>
1043
+ </plugins>
1044
+ <pluginManagement>
1045
+ <plugins>
1046
+ <plugin>
1047
+ <groupId>org.eclipse.m2e</groupId>
1048
+ <artifactId>lifecycle-mapping</artifactId>
1049
+ <version>1.0.0</version>
1050
+ <configuration>
1051
+ <lifecycleMappingMetadata>
1052
+ <pluginExecutions>
1053
+ <pluginExecution>
1054
+ <action>
1055
+ <ignore></ignore>
1056
+ </action>
1057
+ <pluginExecutionFilter>
1058
+ <artifactId>gem-maven-plugin</artifactId>
1059
+ <goals>
1060
+ <goal>initialize</goal>
1061
+ </goals>
1062
+ <groupId>de.saumya.mojo</groupId>
1063
+ <versionRange>[0,)</versionRange>
1064
+ </pluginExecutionFilter>
1065
+ </pluginExecution>
1066
+ </pluginExecutions>
1067
+ </lifecycleMappingMetadata>
1068
+ </configuration>
1069
+ </plugin>
1070
+ </plugins>
1071
+ </pluginManagement>
1072
+ </build>
1073
+ <profiles>
1074
+ <profile>
1075
+ <id>executable</id>
1076
+ <dependencies>
1077
+ <dependency>
1078
+ <groupId>de.saumya.mojo</groupId>
1079
+ <artifactId>gem-assembly-descriptors</artifactId>
1080
+ <version>${jruby.plugins.version}</version>
1081
+ <type>jar</type>
1082
+ <scope>runtime</scope>
1083
+ </dependency>
1084
+ </dependencies>
1085
+ <build>
1086
+ <plugins>
1087
+ <plugin>
1088
+ <artifactId>maven-assembly-plugin</artifactId>
1089
+ <version>_assembly.version_</version>
1090
+ <configuration>
1091
+ <archive>
1092
+ <manifest>
1093
+ <mainClass>de.saumya.mojo.assembly.Main</mainClass>
1094
+ </manifest>
1095
+ </archive>
1096
+ <descriptorRefs>
1097
+ <descriptorRef>jar-with-dependencies-and-gems</descriptorRef>
1098
+ </descriptorRefs>
1099
+ </configuration>
1100
+ <executions>
1101
+ <execution>
1102
+ <id>in_phase_package</id>
1103
+ <phase>package</phase>
1104
+ <goals>
1105
+ <goal>assembly</goal>
1106
+ </goals>
1107
+ </execution>
1108
+ </executions>
1109
+ <dependencies>
1110
+ <dependency>
1111
+ <groupId>de.saumya.mojo</groupId>
1112
+ <artifactId>gem-assembly-descriptors</artifactId>
1113
+ <version>${jruby.plugins.version}</version>
1114
+ <type>jar</type>
1115
+ </dependency>
1116
+ </dependencies>
1117
+ </plugin>
1118
+ </plugins>
1119
+ </build>
1120
+ </profile>
1121
+ </profiles>
1122
+ </project>
1123
+ XML
1124
+ end
1125
+ end
1126
+
1127
+ end