26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/maven/tools/dsl/jars_lock.rb', line 26
def initialize( parent, file = 'Jars.lock' )
file = File.join( parent.basedir, file )
if File.exists?(file)
parent.profile File.basename(file) do
parent.activation do
parent.file( :exists => File.basename(file) )
end
File.read(file).each_line do |line|
data = line.sub(/-\ /, '').strip.split(':')
case data.size
when 3
data = Hash[ [:groupId, :artifactId, :version].zip( data ) ]
parent.jar data[:groupId], data[:artifactId], data[:version], :scope => :compile
when 4
data = Hash[ [:groupId, :artifactId, :version, :scope].zip( data ) ]
parent.jar data[:groupId], data[:artifactId], data[:version], :scope => data[:scope]
when 5
data = Hash[ [:groupId, :artifactId, :classifier, :version, :scope].zip( data ) ]
parent.jar data[:groupId], data[:artifactId], data[:version], :classifier => data[:classifier], :scope => data[:scope]
else
warn "can not parse: #{line}"
end
end
end
end
end
|