maven-tools 0.29.2 → 0.29.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -350,7 +350,8 @@ module Maven
350
350
  if packaging =~ /gem/ || plugin?(:gem)
351
351
  profile('executable') do |exe|
352
352
  exe.jar('de.saumya.mojo:gem-assembly-descriptors', '${jruby.plugins.version}').scope :runtime
353
- exe.plugin(:assembly, '2.2-beta-5') do |a|
353
+ exe.plugin(:assembly) do |a|
354
+ a.version = versions[:assembly_plugin] unless a.version
354
355
  options = {
355
356
  :descriptorRefs => ['jar-with-dependencies-and-gems'],
356
357
  :archive => {:manifest => { :mainClass => 'de.saumya.mojo.assembly.Main' } }
@@ -1,5 +1,5 @@
1
1
  module Maven
2
2
  module Tools
3
- VERSION = '0.29.2'.freeze
3
+ VERSION = '0.29.3'.freeze
4
4
  end
5
5
  end
@@ -3,6 +3,7 @@ module Maven
3
3
  unless defined? VERSIONS
4
4
  VERSIONS = {
5
5
  :jruby_rack => "1.1.6",
6
+ :assembly_plugin => "2.3",
6
7
  :war_plugin => "2.2",
7
8
  :jar_plugin => "2.4",
8
9
  :jruby_plugins => "0.29.0",
@@ -36,7 +36,7 @@ describe Maven::Tools::Jarfile do
36
36
  end
37
37
 
38
38
  it 'generates lockfile' do
39
- subject.generate_lockfile(%w( a b c d e f))
39
+ subject.generate_lockfile(%w( a b c d e f ruby.bundler:bla))
40
40
  File.read(jfile_lock).must_equal <<-EOF
41
41
  a
42
42
  b
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: maven-tools
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.29.2
5
+ version: 0.29.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kristian Meier
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-14 00:00:00 Z
13
+ date: 2012-06-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -83,7 +83,6 @@ files:
83
83
  - lib/maven/model/utils.rb~
84
84
  - lib/maven/model/model.rb~
85
85
  - spec/coordinate_spec.rb
86
- - spec/#jarfile_spec.rb#
87
86
  - spec/jarfile_spec.rb
88
87
  - MIT-LICENSE
89
88
  - README.md
@@ -1,124 +0,0 @@
1
- require 'maven/tools/jarfile'
2
-
3
- class Container
4
-
5
- attr_reader :artifacts, :repositories
6
-
7
- def initialize
8
- @artifacts = []
9
- @repositories = []
10
- end
11
-
12
- def add_artifact(a)
13
- @artifacts << a
14
- end
15
-
16
- def add_repository(name, url)
17
- @repositories << name
18
- end
19
- end
20
-
21
- describe Maven::Tools::Jarfile do
22
-
23
- let(:workdir) { 'target' }
24
- let(:jfile) { File.join(workdir, 'tmp-jarfile') }
25
- let(:jfile_lock) { jfile + ".lock"}
26
- let(:container) { Container.new }
27
- subject { Maven::Tools::Jarfile.new(jfile) }
28
-
29
- before do
30
- FileUtils.mkdir_p workdir
31
- Dir[File.join(workdir, "tmp*")].each { |f| FileUtils.rm_f f }
32
- end
33
-
34
- after do
35
- FileUtils.rm_rf(File.join(workdir, "tmp-*"))
36
- end
37
-
38
- it 'generates lockfile' do
39
- subject.generate_lockfile(%w( a b c d e f ruby.bundler:bla))
40
- File.read(jfile_lock).must_equal <<-EOF
41
- a
42
- b
43
- c
44
- d
45
- e
46
- f
47
- EOF
48
- end
49
-
50
- it 'check locked coordinate' do
51
- File.open(jfile_lock, 'w') do |f|
52
- f.write <<-EOF
53
- a:b:pom:3
54
- a:c:jar:1
55
- EOF
56
- end
57
- subject.locked.must_equal ["a:b:pom:3", "a:c:jar:1"]
58
- subject.locked?("a:b:pom:321").must_equal true
59
- subject.locked?("a:b:jar:321").must_equal true
60
- subject.locked?("a:d:jar:432").must_equal false
61
- end
62
-
63
- it 'populate repositories' do
64
- File.open(jfile, 'w') do |f|
65
- f.write <<-EOF
66
- repository :first, "http://example.com/repo"
67
- source 'second', "http://example.org/repo"
68
- source "http://example.org/repo/3"
69
- EOF
70
- end
71
- subject.populate_unlocked container
72
- container.repositories.size.must_equal 3
73
- container.artifacts.size.must_equal 0
74
- container.repositories[0].must_equal "first"
75
- container.repositories[1].must_equal "second"
76
- container.repositories[2].must_equal "http://example.org/repo/3"
77
- end
78
-
79
- it 'populate artifacts without locked' do
80
- File.open(jfile, 'w') do |f|
81
- f.write <<-EOF
82
- jar 'a:b', '123'
83
- pom 'x:y', '987'
84
- EOF
85
- end
86
- subject.populate_unlocked container
87
- container.repositories.size.must_equal 0
88
- container.artifacts.size.must_equal 2
89
- container.artifacts[0].to_s.must_equal "a:b:jar:123"
90
- container.artifacts[1].to_s.must_equal "x:y:pom:987"
91
- end
92
-
93
- it 'populate artifacts with locked' do
94
- File.open(jfile, 'w') do |f|
95
- f.write <<-EOF
96
- jar 'a:b', '123'
97
- pom 'x:y', '987'
98
- EOF
99
- end
100
- File.open(jfile_lock, 'w') do |f|
101
- f.write <<-EOF
102
- a:b:jar:432
103
- EOF
104
- end
105
-
106
- subject.populate_unlocked container
107
- container.repositories.size.must_equal 0
108
- container.artifacts.size.must_equal 1
109
- container.artifacts[0].to_s.must_equal "x:y:pom:987"
110
- end
111
-
112
- it 'populate locked artifacts' do
113
- File.open(jfile_lock, 'w') do |f|
114
- f.write <<-EOF
115
- a:b:jar:432
116
- EOF
117
- end
118
-
119
- subject.populate_locked container
120
- container.repositories.size.must_equal 0
121
- container.artifacts.size.must_equal 1
122
- container.artifacts[0].to_s.must_equal "a:b:jar:432"
123
- end
124
- end