-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven_utils.rb
92 lines (90 loc) · 2.67 KB
/
maven_utils.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
module MavenUtils
@@maven_dep_set = {
'1.5.1' => {
'axis2' => '1.5.1',
'XmlSchema' => '1.4.3',
'axiom-dom' => '1.2.8',
'axiom-api' => '1.2.8',
'axiom-impl' => '1.2.8',
'commons-codec' => '1.3',
'commons-httpclient' => '3.1',
'commons-logging' => '1.1.1',
'httpcore' => '4.0',
'neethi' => '2.0.4',
'wsdl4j' => '1.6.2',
#build-only
'activation' => '1.1',
'geronimo-stax-api_1.0_spec' => '1.0.1',
'wstx-asl' => '3.2.4',
'xalan' => '2.7.0',
'xmlbeans' => '2.3.0',
#test-only
'axis2-transport-http' => '1.5.1',
'axis2-transport-local' => '1.5.1',
'mail' => '1.4',
'woden-api' => '1.0M8'
},
'1.5.3-SNAPSHOT' => {
#common
'axis2' => '1.5.3-SNAPSHOT',
'XmlSchema' => '1.4.3',
'axiom-dom' => '1.2.9',
'axiom-api' => '1.2.9',
'axiom-impl' => '1.2.9',
'commons-codec' => '1.3',
'commons-httpclient' => '3.1',
'commons-logging' => '1.1.1',
'httpcore' => '4.0',
'neethi' => '2.0.4',
'wsdl4j' => '1.6.2',
#build-only
'activation' => '1.1',
'geronimo-stax-api_1.0_spec' => '1.0.1',
'wstx-asl' => '3.2.9',
'xalan' => '2.7.0',
'xmlbeans' => '2.3.0',
#test-only
'axis2-transport-http' => '1.5.3-SNAPSHOT',
'axis2-transport-local' => '1.5.3-SNAPSHOT',
'mail' => '1.4',
'woden-api' => '1.0M8'
},
'SNAPSHOT' => {
#common
'axis2' => 'SNAPSHOT',
'XmlSchema' => '1.4.7',
'axiom-dom' => '1.2.10-SNAPSHOT',
'axiom-api' => '1.2.10-SNAPSHOT',
'axiom-impl' => '1.2.10-SNAPSHOT',
'commons-codec' => '1.3',
'commons-httpclient' => '3.1',
'commons-logging' => '1.1.1',
'httpcore' => '4.0',
'neethi' => '3.0.0-SNAPSHOT',
'wsdl4j' => '1.6.2',
#build-only
'activation' => '1.1',
'geronimo-stax-api_1.0_spec' => '1.0.1',
'wstx-asl' => '3.2.9',
'xalan' => '2.7.0',
'xmlbeans' => '2.3.0',
#test-only
'axis2-transport-http' => 'SNAPSHOT',
'axis2-transport-local' => 'SNAPSHOT',
'mail' => '1.4',
'woden-api' => '1.0-SNAPSHOT'
}
}
def maven_location(h)
group = h[:group]
artifact = h[:artifact]
set = h[:set]
version = h[:version]
raise ArgumentError.new("group and artifact are required") unless group && artifact
raise ArgumentError.new("set or version is required") unless set || version
version ||= @@maven_dep_set[set][artifact]
group_dir = group.gsub(/\./, "/")
user_home = File.expand_path("~")
"#{user_home}/.m2/repository/#{group_dir}/#{artifact}/#{version}/#{artifact}-#{version}.jar"
end
end