commit | author | age
|
f13c4c
|
1 |
/*
|
JM |
2 |
* Copyright 2011 gitblit.com.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
22fc5e
|
16 |
package com.gitblit.build;
|
5fe7df
|
17 |
|
JM |
18 |
import java.io.BufferedInputStream;
|
|
19 |
import java.io.ByteArrayOutputStream;
|
|
20 |
import java.io.File;
|
155bf7
|
21 |
import java.io.FileInputStream;
|
2a7306
|
22 |
import java.io.FileWriter;
|
5fe7df
|
23 |
import java.io.IOException;
|
JM |
24 |
import java.io.InputStream;
|
|
25 |
import java.io.RandomAccessFile;
|
|
26 |
import java.net.URL;
|
155bf7
|
27 |
import java.text.MessageFormat;
|
JM |
28 |
import java.util.ArrayList;
|
|
29 |
import java.util.Collections;
|
87cc1e
|
30 |
import java.util.HashMap;
|
155bf7
|
31 |
import java.util.List;
|
87cc1e
|
32 |
import java.util.Map;
|
155bf7
|
33 |
import java.util.Properties;
|
87cc1e
|
34 |
|
22fc5e
|
35 |
import com.gitblit.Constants;
|
87cc1e
|
36 |
import com.gitblit.utils.StringUtils;
|
5fe7df
|
37 |
|
892570
|
38 |
/**
|
JM |
39 |
* The Build class downloads runtime and compile-time jar files from the Apache
|
|
40 |
* or Eclipse Maven repositories.
|
|
41 |
*
|
|
42 |
* It also generates the Keys class from the gitblit.properties file.
|
|
43 |
*
|
|
44 |
* Its important that this class have minimal compile dependencies since its
|
|
45 |
* called very early in the build script.
|
|
46 |
*
|
|
47 |
* @author James Moger
|
|
48 |
*
|
|
49 |
*/
|
5fe7df
|
50 |
public class Build {
|
a7a9f7
|
51 |
|
841651
|
52 |
public interface DownloadListener {
|
JM |
53 |
public void downloading(String name);
|
|
54 |
}
|
a7a9f7
|
55 |
|
88598b
|
56 |
/**
|
JM |
57 |
* BuildType enumeration representing compile-time or runtime. This is used
|
|
58 |
* to download dependencies either for Gitblit GO runtime or for setting up
|
|
59 |
* a development environment.
|
|
60 |
*/
|
cf9550
|
61 |
public static enum BuildType {
|
JM |
62 |
RUNTIME, COMPILETIME;
|
|
63 |
}
|
a7a9f7
|
64 |
|
841651
|
65 |
private static DownloadListener downloadListener;
|
cf9550
|
66 |
|
5fe7df
|
67 |
public static void main(String... args) {
|
JM |
68 |
runtime();
|
|
69 |
compiletime();
|
155bf7
|
70 |
buildSettingKeys();
|
5fe7df
|
71 |
}
|
JM |
72 |
|
|
73 |
public static void runtime() {
|
cf9550
|
74 |
downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME);
|
JM |
75 |
downloadFromApache(MavenObject.JETTY, BuildType.RUNTIME);
|
|
76 |
downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME);
|
|
77 |
downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);
|
|
78 |
downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME);
|
|
79 |
downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME);
|
|
80 |
downloadFromApache(MavenObject.WICKET, BuildType.RUNTIME);
|
|
81 |
downloadFromApache(MavenObject.WICKET_EXT, BuildType.RUNTIME);
|
|
82 |
downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.RUNTIME);
|
|
83 |
downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.RUNTIME);
|
|
84 |
downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.RUNTIME);
|
|
85 |
downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.RUNTIME);
|
5b60db
|
86 |
downloadFromApache(MavenObject.BOUNCYCASTLE_MAIL, BuildType.RUNTIME);
|
424fe1
|
87 |
downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME);
|
c22722
|
88 |
downloadFromApache(MavenObject.ROME, BuildType.RUNTIME);
|
JM |
89 |
downloadFromApache(MavenObject.JDOM, BuildType.RUNTIME);
|
831469
|
90 |
downloadFromApache(MavenObject.GSON, BuildType.RUNTIME);
|
JM |
91 |
downloadFromApache(MavenObject.MAIL, BuildType.RUNTIME);
|
fa54be
|
92 |
downloadFromApache(MavenObject.GROOVY, BuildType.RUNTIME);
|
cf9550
|
93 |
|
JM |
94 |
downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);
|
|
95 |
downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.RUNTIME);
|
5fe7df
|
96 |
}
|
JM |
97 |
|
|
98 |
public static void compiletime() {
|
cf9550
|
99 |
downloadFromApache(MavenObject.JUNIT, BuildType.RUNTIME);
|
JM |
100 |
downloadFromApache(MavenObject.JCOMMANDER, BuildType.COMPILETIME);
|
|
101 |
downloadFromApache(MavenObject.JETTY, BuildType.COMPILETIME);
|
|
102 |
downloadFromApache(MavenObject.SERVLET, BuildType.COMPILETIME);
|
|
103 |
downloadFromApache(MavenObject.SLF4JAPI, BuildType.COMPILETIME);
|
|
104 |
downloadFromApache(MavenObject.SLF4LOG4J, BuildType.COMPILETIME);
|
|
105 |
downloadFromApache(MavenObject.LOG4J, BuildType.COMPILETIME);
|
|
106 |
downloadFromApache(MavenObject.WICKET, BuildType.COMPILETIME);
|
|
107 |
downloadFromApache(MavenObject.WICKET_EXT, BuildType.COMPILETIME);
|
|
108 |
downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.COMPILETIME);
|
|
109 |
downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.COMPILETIME);
|
|
110 |
downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.COMPILETIME);
|
|
111 |
downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.COMPILETIME);
|
5b60db
|
112 |
downloadFromApache(MavenObject.BOUNCYCASTLE_MAIL, BuildType.COMPILETIME);
|
2a7306
|
113 |
downloadFromApache(MavenObject.JSCH, BuildType.COMPILETIME);
|
c22722
|
114 |
downloadFromApache(MavenObject.ROME, BuildType.COMPILETIME);
|
JM |
115 |
downloadFromApache(MavenObject.JDOM, BuildType.COMPILETIME);
|
831469
|
116 |
downloadFromApache(MavenObject.GSON, BuildType.COMPILETIME);
|
JM |
117 |
downloadFromApache(MavenObject.MAIL, BuildType.COMPILETIME);
|
fa54be
|
118 |
downloadFromApache(MavenObject.GROOVY, BuildType.COMPILETIME);
|
JM |
119 |
|
cf9550
|
120 |
downloadFromEclipse(MavenObject.JGIT, BuildType.COMPILETIME);
|
JM |
121 |
downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.COMPILETIME);
|
85c2e6
|
122 |
|
81f881
|
123 |
// needed for site publishing
|
JM |
124 |
downloadFromApache(MavenObject.COMMONSNET, BuildType.RUNTIME);
|
155bf7
|
125 |
}
|
a7a9f7
|
126 |
|
f6740d
|
127 |
public static void federationClient() {
|
JM |
128 |
downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME);
|
|
129 |
downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME);
|
|
130 |
downloadFromApache(MavenObject.MAIL, BuildType.RUNTIME);
|
|
131 |
downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);
|
|
132 |
downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME);
|
|
133 |
downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME);
|
841651
|
134 |
downloadFromApache(MavenObject.GSON, BuildType.RUNTIME);
|
JM |
135 |
downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME);
|
a7a9f7
|
136 |
|
841651
|
137 |
downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);
|
JM |
138 |
}
|
a7a9f7
|
139 |
|
JM |
140 |
public static void manager(DownloadListener listener) {
|
841651
|
141 |
downloadListener = listener;
|
595bbf
|
142 |
downloadFromApache(MavenObject.GSON, BuildType.RUNTIME);
|
4cac0d
|
143 |
downloadFromApache(MavenObject.ROME, BuildType.RUNTIME);
|
JM |
144 |
downloadFromApache(MavenObject.JDOM, BuildType.RUNTIME);
|
595bbf
|
145 |
downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME);
|
JM |
146 |
|
|
147 |
downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);
|
f6740d
|
148 |
}
|
155bf7
|
149 |
|
892570
|
150 |
/**
|
JM |
151 |
* Builds the Keys class based on the gitblit.properties file and inserts
|
|
152 |
* the class source into the project source folder.
|
|
153 |
*/
|
155bf7
|
154 |
public static void buildSettingKeys() {
|
87cc1e
|
155 |
// Load all keys
|
155bf7
|
156 |
Properties properties = new Properties();
|
2a7306
|
157 |
FileInputStream is = null;
|
155bf7
|
158 |
try {
|
2a7306
|
159 |
is = new FileInputStream(Constants.PROPERTIES_FILE);
|
JM |
160 |
properties.load(is);
|
155bf7
|
161 |
} catch (Throwable t) {
|
JM |
162 |
t.printStackTrace();
|
2a7306
|
163 |
} finally {
|
JM |
164 |
if (is != null) {
|
|
165 |
try {
|
|
166 |
is.close();
|
|
167 |
} catch (Throwable t) {
|
|
168 |
// IGNORE
|
|
169 |
}
|
|
170 |
}
|
155bf7
|
171 |
}
|
JM |
172 |
List<String> keys = new ArrayList<String>(properties.stringPropertyNames());
|
|
173 |
Collections.sort(keys);
|
|
174 |
|
87cc1e
|
175 |
// Determine static key group classes
|
JM |
176 |
Map<String, List<String>> staticClasses = new HashMap<String, List<String>>();
|
|
177 |
staticClasses.put("", new ArrayList<String>());
|
|
178 |
for (String key : keys) {
|
|
179 |
String clazz = "";
|
|
180 |
String field = key;
|
|
181 |
if (key.indexOf('.') > -1) {
|
|
182 |
clazz = key.substring(0, key.indexOf('.'));
|
|
183 |
field = key.substring(key.indexOf('.') + 1);
|
|
184 |
}
|
|
185 |
if (!staticClasses.containsKey(clazz)) {
|
|
186 |
staticClasses.put(clazz, new ArrayList<String>());
|
|
187 |
}
|
|
188 |
staticClasses.get(clazz).add(field);
|
|
189 |
}
|
|
190 |
|
|
191 |
// Assemble Keys source file
|
155bf7
|
192 |
StringBuilder sb = new StringBuilder();
|
JM |
193 |
sb.append("package com.gitblit;\n");
|
2a7306
|
194 |
sb.append('\n');
|
155bf7
|
195 |
sb.append("/*\n");
|
JM |
196 |
sb.append(" * This class is auto-generated from the properties file.\n");
|
|
197 |
sb.append(" * Do not version control!\n");
|
|
198 |
sb.append(" */\n");
|
|
199 |
sb.append("public final class Keys {\n");
|
2a7306
|
200 |
sb.append('\n');
|
87cc1e
|
201 |
List<String> classSet = new ArrayList<String>(staticClasses.keySet());
|
JM |
202 |
Collections.sort(classSet);
|
|
203 |
for (String clazz : classSet) {
|
|
204 |
List<String> keySet = staticClasses.get(clazz);
|
|
205 |
if (clazz.equals("")) {
|
|
206 |
// root keys
|
|
207 |
for (String key : keySet) {
|
2a7306
|
208 |
sb.append(MessageFormat.format(
|
JM |
209 |
"\tpublic static final String {0} = \"{1}\";\n\n",
|
|
210 |
key.replace('.', '_'), key));
|
87cc1e
|
211 |
}
|
JM |
212 |
} else {
|
|
213 |
// class keys
|
|
214 |
sb.append(MessageFormat.format("\tpublic static final class {0} '{'\n\n", clazz));
|
2a7306
|
215 |
sb.append(MessageFormat.format(
|
JM |
216 |
"\t\tpublic static final String _ROOT = \"{0}\";\n\n", clazz));
|
87cc1e
|
217 |
for (String key : keySet) {
|
2a7306
|
218 |
sb.append(MessageFormat.format(
|
JM |
219 |
"\t\tpublic static final String {0} = \"{1}\";\n\n",
|
|
220 |
key.replace('.', '_'), clazz + "." + key));
|
87cc1e
|
221 |
}
|
JM |
222 |
sb.append("\t}\n\n");
|
|
223 |
}
|
155bf7
|
224 |
}
|
2a7306
|
225 |
sb.append('}');
|
87cc1e
|
226 |
|
JM |
227 |
// Save Keys class definition
|
155bf7
|
228 |
try {
|
JM |
229 |
File file = new File("src/com/gitblit/Keys.java");
|
2a7306
|
230 |
FileWriter fw = new FileWriter(file, false);
|
JM |
231 |
fw.write(sb.toString());
|
|
232 |
fw.close();
|
155bf7
|
233 |
} catch (Throwable t) {
|
JM |
234 |
t.printStackTrace();
|
|
235 |
}
|
5fe7df
|
236 |
}
|
JM |
237 |
|
|
238 |
/**
|
cf9550
|
239 |
* Download a file from the official Apache Maven repository.
|
JM |
240 |
*
|
|
241 |
* @param mo
|
|
242 |
* the maven object to download.
|
|
243 |
* @return
|
|
244 |
*/
|
|
245 |
private static List<File> downloadFromApache(MavenObject mo, BuildType type) {
|
|
246 |
return downloadFromMaven("http://repo1.maven.org/maven2/", mo, type);
|
|
247 |
}
|
|
248 |
|
|
249 |
/**
|
|
250 |
* Download a file from the official Eclipse Maven repository.
|
|
251 |
*
|
|
252 |
* @param mo
|
|
253 |
* the maven object to download.
|
|
254 |
* @return
|
|
255 |
*/
|
|
256 |
private static List<File> downloadFromEclipse(MavenObject mo, BuildType type) {
|
|
257 |
return downloadFromMaven("http://download.eclipse.org/jgit/maven/", mo, type);
|
|
258 |
}
|
|
259 |
|
|
260 |
/**
|
5fe7df
|
261 |
* Download a file from a Maven repository.
|
JM |
262 |
*
|
|
263 |
* @param mo
|
|
264 |
* the maven object to download.
|
|
265 |
* @return
|
|
266 |
*/
|
cf9550
|
267 |
private static List<File> downloadFromMaven(String mavenRoot, MavenObject mo, BuildType type) {
|
JM |
268 |
List<File> downloads = new ArrayList<File>();
|
|
269 |
String[] jars = { "" };
|
|
270 |
if (BuildType.RUNTIME.equals(type)) {
|
|
271 |
jars = new String[] { "" };
|
|
272 |
} else if (BuildType.COMPILETIME.equals(type)) {
|
615af1
|
273 |
jars = new String[] { "-sources" };
|
5fe7df
|
274 |
}
|
cf9550
|
275 |
for (String jar : jars) {
|
JM |
276 |
File targetFile = mo.getLocalFile("ext", jar);
|
|
277 |
if (targetFile.exists()) {
|
|
278 |
downloads.add(targetFile);
|
|
279 |
continue;
|
|
280 |
}
|
|
281 |
String expectedSHA1 = mo.getSHA1(jar);
|
|
282 |
if (expectedSHA1 == null) {
|
|
283 |
// skip this jar
|
|
284 |
continue;
|
|
285 |
}
|
|
286 |
float approximateLength = mo.getApproximateLength(jar);
|
|
287 |
String mavenURL = mavenRoot + mo.getRepositoryPath(jar);
|
|
288 |
if (!targetFile.getAbsoluteFile().getParentFile().exists()) {
|
|
289 |
boolean success = targetFile.getAbsoluteFile().getParentFile().mkdirs();
|
|
290 |
if (!success) {
|
|
291 |
throw new RuntimeException("Failed to create destination folder structure!");
|
|
292 |
}
|
|
293 |
}
|
841651
|
294 |
if (downloadListener != null) {
|
595bbf
|
295 |
downloadListener.downloading(mo.name + "...");
|
841651
|
296 |
}
|
cf9550
|
297 |
ByteArrayOutputStream buff = new ByteArrayOutputStream();
|
JM |
298 |
try {
|
|
299 |
URL url = new URL(mavenURL);
|
|
300 |
InputStream in = new BufferedInputStream(url.openStream());
|
|
301 |
byte[] buffer = new byte[4096];
|
|
302 |
int downloadedLen = 0;
|
|
303 |
float lastProgress = 0f;
|
2a7306
|
304 |
|
cf9550
|
305 |
updateDownload(0, targetFile);
|
JM |
306 |
while (true) {
|
|
307 |
int len = in.read(buffer);
|
|
308 |
if (len < 0) {
|
|
309 |
break;
|
|
310 |
}
|
|
311 |
downloadedLen += len;
|
|
312 |
buff.write(buffer, 0, len);
|
|
313 |
float progress = downloadedLen / approximateLength;
|
|
314 |
if (progress - lastProgress >= 0.1f) {
|
|
315 |
lastProgress = progress;
|
|
316 |
updateDownload(progress, targetFile);
|
595bbf
|
317 |
if (downloadListener != null) {
|
9d25a4
|
318 |
int percent = Math.min(100, Math.round(100 * progress));
|
595bbf
|
319 |
downloadListener.downloading(mo.name + " (" + percent + "%)");
|
JM |
320 |
}
|
cf9550
|
321 |
}
|
JM |
322 |
}
|
|
323 |
in.close();
|
|
324 |
updateDownload(1f, targetFile);
|
595bbf
|
325 |
if (downloadListener != null) {
|
JM |
326 |
downloadListener.downloading(mo.name + " (100%)");
|
|
327 |
}
|
2a7306
|
328 |
|
cf9550
|
329 |
} catch (IOException e) {
|
JM |
330 |
throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e);
|
|
331 |
}
|
|
332 |
byte[] data = buff.toByteArray();
|
|
333 |
String calculatedSHA1 = StringUtils.getSHA1(data);
|
5fe7df
|
334 |
|
cf9550
|
335 |
System.out.println();
|
JM |
336 |
|
|
337 |
if (expectedSHA1.length() == 0) {
|
|
338 |
updateProgress(0, "sha: " + calculatedSHA1);
|
|
339 |
System.out.println();
|
|
340 |
} else {
|
|
341 |
if (!calculatedSHA1.equals(expectedSHA1)) {
|
|
342 |
throw new RuntimeException("SHA1 checksum mismatch; got: " + calculatedSHA1);
|
5fe7df
|
343 |
}
|
JM |
344 |
}
|
cf9550
|
345 |
try {
|
JM |
346 |
RandomAccessFile ra = new RandomAccessFile(targetFile, "rw");
|
|
347 |
ra.write(data);
|
|
348 |
ra.setLength(data.length);
|
|
349 |
ra.close();
|
|
350 |
} catch (IOException e) {
|
|
351 |
throw new RuntimeException("Error writing to file " + targetFile, e);
|
|
352 |
}
|
|
353 |
downloads.add(targetFile);
|
5fe7df
|
354 |
}
|
cf9550
|
355 |
return downloads;
|
JM |
356 |
}
|
2a7306
|
357 |
|
cf9550
|
358 |
private static void updateDownload(float progress, File file) {
|
JM |
359 |
updateProgress(progress, "d/l: " + file.getName());
|
|
360 |
}
|
|
361 |
|
|
362 |
private static void updateProgress(float progress, String url) {
|
|
363 |
String anim = "==========";
|
|
364 |
int width = Math.round(anim.length() * progress);
|
|
365 |
System.out.print("\r[");
|
9cf48d
|
366 |
System.out.print(anim.substring(0, Math.min(width, anim.length())));
|
2a7306
|
367 |
for (int i = 0; i < anim.length() - width; i++) {
|
JM |
368 |
System.out.print(' ');
|
5fe7df
|
369 |
}
|
cf9550
|
370 |
System.out.print("] " + url);
|
5fe7df
|
371 |
}
|
JM |
372 |
|
88598b
|
373 |
/**
|
JM |
374 |
* MavenObject represents a complete maven artifact (binary, sources, and
|
|
375 |
* javadoc). MavenObjects can be downloaded and checksummed to confirm
|
|
376 |
* authenticity.
|
|
377 |
*/
|
5fe7df
|
378 |
private static class MavenObject {
|
JM |
379 |
|
2a7306
|
380 |
public static final MavenObject JCOMMANDER = new MavenObject("jCommander", "com/beust",
|
JM |
381 |
"jcommander", "1.17", 34000, 32000, 141000,
|
|
382 |
"219a3540f3b27d7cc3b1d91d6ea046cd8723290e",
|
|
383 |
"0bb50eec177acf0e94d58e0cf07262fe5164331d",
|
|
384 |
"c7adc475ca40c288c93054e0f4fe58f3a98c0cb5");
|
5fe7df
|
385 |
|
2a7306
|
386 |
public static final MavenObject JETTY = new MavenObject("Jetty",
|
0d3e3c
|
387 |
"org/eclipse/jetty/aggregate", "jetty-webapp", "7.4.3.v20110701", 1000000, 680000,
|
JM |
388 |
2720000, "bde072b178f9650e2308f0babe58a4baaa469e3c",
|
|
389 |
"bc75f05dd4f7fa848720ac669b8b438ee4a6b146",
|
|
390 |
"dcd42f672e734521d1a6ccc0c2f9ecded1a1a281");
|
5fe7df
|
391 |
|
bd9800
|
392 |
public static final MavenObject SERVLET = new MavenObject("Servlet 3.0", "org/glassfish",
|
JM |
393 |
"javax.servlet", "3.0.1", 84000, 211000, 0,
|
|
394 |
"58f17c941cd0607bb5edcbcafc491d02265ac9a1",
|
|
395 |
"63f2f8bcdd3f138020bbadd5c847e8f3847b77d2", null);
|
5fe7df
|
396 |
|
2a7306
|
397 |
public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j",
|
JM |
398 |
"slf4j-api", "1.6.1", 25500, 45000, 182000,
|
|
399 |
"6f3b8a24bf970f17289b234284c94f43eb42f0e4",
|
|
400 |
"46a386136c901748e6a3af67ebde6c22bc6b4524",
|
|
401 |
"e223571d77769cdafde59040da235842f3326453");
|
5fe7df
|
402 |
|
2a7306
|
403 |
public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j",
|
JM |
404 |
"slf4j-log4j12", "1.6.1", 9800, 9500, 52400,
|
|
405 |
"bd245d6746cdd4e6203e976e21d597a46f115802",
|
|
406 |
"7a26b08b265f55622fa1fed3bda68bbd37a465ba",
|
|
407 |
"6e4b16bce7994e3692e82002f322a0dd2f32741e");
|
5fe7df
|
408 |
|
2a7306
|
409 |
public static final MavenObject LOG4J = new MavenObject("Apache LOG4J", "log4j", "log4j",
|
JM |
410 |
"1.2.16", 481000, 471000, 1455000, "7999a63bfccbc7c247a9aea10d83d4272bd492c6",
|
|
411 |
"bf945d1dc995be7fe64923625f842fbb6bf443be",
|
|
412 |
"78aa1cbf0fa3b259abdc7d87f9f6788d785aac2a");
|
5fe7df
|
413 |
|
2a7306
|
414 |
public static final MavenObject WICKET = new MavenObject("Apache Wicket",
|
074b4b
|
415 |
"org/apache/wicket", "wicket", "1.4.19", 1960000, 1906000, 6818000,
|
JM |
416 |
"7e6af5cadaf6c9b7e068e45cf2ffbea3cc91592f",
|
|
417 |
"5e91cf00efaf2fedeef98e13464a4230e5966588",
|
|
418 |
"5dde8afbe5eb2314a704cb74938c1b651b2cf190");
|
5fe7df
|
419 |
|
2a7306
|
420 |
public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions",
|
074b4b
|
421 |
"org/apache/wicket", "wicket-extensions", "1.4.19", 1180000, 1118000, 1458000,
|
JM |
422 |
"c7a1d343e216cdc2e692b6fabc6eaeca9aa24ca4",
|
|
423 |
"6c2e2ad89b69fc9977c24467e3aa0d7f6c75a579",
|
|
424 |
"3a3082fb106173f7ca069a6f5969cc8d347d9f44");
|
5fe7df
|
425 |
|
2a7306
|
426 |
public static final MavenObject WICKET_AUTH_ROLES = new MavenObject(
|
074b4b
|
427 |
"Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.19",
|
JM |
428 |
44000, 45000, 166000, "70c26ac4cd167bf7323372d2d49eb2a9beff73b9",
|
|
429 |
"ca219726c1768a9483e4a0bb6550881babfe46d6",
|
|
430 |
"17753908f8a9e997c464a69765b4682126fa1fd6");
|
155bf7
|
431 |
|
2a7306
|
432 |
public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject(
|
94dfef
|
433 |
"Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.18",
|
JM |
434 |
34000, 18750, 161000, "1f763cc8a04e62840b63787a77a479b04ad99c75",
|
|
435 |
"1521ed6397192c464e89787502f937bc96ece8f8",
|
|
436 |
"8b0398d58bce63ba7f7a9232c4ca24160c9b1a11");
|
531cd2
|
437 |
|
5450d0
|
438 |
public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "4.8.2",
|
JM |
439 |
237000, 0, 0, "c94f54227b08100974c36170dcb53329435fe5ad", "", "");
|
5fe7df
|
440 |
|
2a7306
|
441 |
public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers",
|
b7646f
|
442 |
"org/tautua/markdownpapers", "markdownpapers-core", "1.2.5", 87000, 58000, 268000,
|
JM |
443 |
"295910b1893d73d4803f9ea2790ee1d10c466364",
|
|
444 |
"2170f358f29886aea8794c4bfdb6f1b27b152b9b",
|
|
445 |
"481599f34cb2abe4a9ebc771d8d81823375ec1ce");
|
2a7306
|
446 |
|
JM |
447 |
public static final MavenObject BOUNCYCASTLE = new MavenObject("BouncyCastle",
|
|
448 |
"org/bouncycastle", "bcprov-jdk16", "1.46", 1900000, 1400000, 4670000,
|
|
449 |
"ce091790943599535cbb4de8ede84535b0c1260c",
|
|
450 |
"d2b70567594225923450d7e3f80cd022c852725e",
|
|
451 |
"873a6fe765f33fc27df498a5d1f5bf077e503b2f");
|
|
452 |
|
|
453 |
public static final MavenObject BOUNCYCASTLE_MAIL = new MavenObject("BouncyCastle Mail",
|
|
454 |
"org/bouncycastle", "bcmail-jdk16", "1.46", 502000, 420000, 482000,
|
|
455 |
"08a9233bfd6ad38ea32df5e6ff91035b650584b9",
|
|
456 |
"3ebd62bc56854767512dc5deec0a17795f2e671d",
|
|
457 |
"3b7c5f3938f202311bdca0bf7ed46bc0118af081");
|
|
458 |
|
|
459 |
public static final MavenObject JGIT = new MavenObject("JGit", "org/eclipse/jgit",
|
367505
|
460 |
"org.eclipse.jgit", "1.2.0.201112221803-r", 1318000, 1354000, 3300000,
|
JM |
461 |
"f3bbea50b64c2c8e20176f412d2f063bd132878f",
|
|
462 |
"f6c616413540e226a6b72bc573a40410412e234f",
|
|
463 |
"a77e5ee65ba284d12ae444ac42e12948a9314c20");
|
2a7306
|
464 |
|
JM |
465 |
public static final MavenObject JGIT_HTTP = new MavenObject("JGit", "org/eclipse/jgit",
|
367505
|
466 |
"org.eclipse.jgit.http.server", "1.2.0.201112221803-r", 68000, 62000, 110000,
|
JM |
467 |
"0d0004423b71bf7c29cd4ad85010c293c4fab95f",
|
|
468 |
"89be774b6db17bbc47b4757ae9e5178750064880",
|
|
469 |
"4cde29a085200ccf46ac677aeb1abb39352a3a6a");
|
1f9dae
|
470 |
|
JM |
471 |
public static final MavenObject JSCH = new MavenObject("JSch", "com/jcraft", "jsch",
|
|
472 |
"0.1.44-1", 214000, 211000, 413000, "2e9ae08de5a71bd0e0d3ba2558598181bfa71d4e",
|
2a7306
|
473 |
"e528f593b19b04d500992606f58b87fcfded8883",
|
JM |
474 |
"d0ffadd0a4ab909d94a577b5aad43c13b617ddcb");
|
531cd2
|
475 |
|
85c2e6
|
476 |
public static final MavenObject COMMONSNET = new MavenObject("commons-net", "commons-net",
|
JM |
477 |
"commons-net", "1.4.0", 181000, 0, 0, "eb47e8cad2dd7f92fd7e77df1d1529cae87361f7",
|
|
478 |
"", "");
|
|
479 |
|
|
480 |
public static final MavenObject ROME = new MavenObject("rome", "rome", "rome", "0.9",
|
|
481 |
208000, 196000, 407000, "dee2705dd01e79a5a96a17225f5a1ae30470bb18",
|
c22722
|
482 |
"226f851dc44fd94fe70b9c471881b71f88949cbf",
|
JM |
483 |
"8d7d867b97eeb3a9196c3926da550ad042941c1b");
|
|
484 |
|
85c2e6
|
485 |
public static final MavenObject JDOM = new MavenObject("jdom", "org/jdom", "jdom", "1.1",
|
JM |
486 |
153000, 235000, 445000, "1d04c0f321ea337f3661cf7ede8f4c6f653a8fdd",
|
c22722
|
487 |
"a7ed425c4c46605b8f2bf2ee118c1609682f4f2c",
|
JM |
488 |
"f3df91edccba2f07a0fced70887c2f7b7836cb75");
|
81f881
|
489 |
|
831469
|
490 |
public static final MavenObject GSON = new MavenObject("gson", "com/google/code/gson",
|
JM |
491 |
"gson", "1.7.1", 174000, 142000, 247000,
|
|
492 |
"0697e3a1fa094a983cd12f7f6f61abf9c6ea52e2",
|
|
493 |
"51f6f78aec2d30d0c2bfb4a5f00d456a6f7a5e7e",
|
|
494 |
"f0872fe17d484815328538b89909d5e46d85db74");
|
|
495 |
|
|
496 |
public static final MavenObject MAIL = new MavenObject("javax.mail", "javax/mail", "mail",
|
|
497 |
"1.4.3", 462000, 642000, 0, "8154bf8d666e6db154c548dc31a8d512c273f5ee",
|
|
498 |
"5875e2729de83a4e46391f8f979ec8bd03810c10", null);
|
|
499 |
|
fa54be
|
500 |
public static final MavenObject GROOVY = new MavenObject("groovy", "org/codehaus/groovy", "groovy-all",
|
c7bcdc
|
501 |
"1.8.5", 6143000, 2290000, 4608000, "3be3914c49ca7d8e8afb29a7772a74c30a1f1b28",
|
JM |
502 |
"1435cc8c90e3a91e5fee7bb53e83aad96e93aeb7", "5a214b52286523f9e2a4b5fed526506c763fa6f1");
|
fa54be
|
503 |
|
5fe7df
|
504 |
public final String name;
|
JM |
505 |
public final String group;
|
|
506 |
public final String artifact;
|
|
507 |
public final String version;
|
2a7306
|
508 |
public final int approxLibraryLen;
|
JM |
509 |
public final int approxSourcesLen;
|
|
510 |
public final int approxJavadocLen;
|
|
511 |
public final String librarySHA1;
|
|
512 |
public final String sourcesSHA1;
|
|
513 |
public final String javadocSHA1;
|
5fe7df
|
514 |
|
2a7306
|
515 |
private MavenObject(String name, String group, String artifact, String version,
|
JM |
516 |
int approxLibraryLen, int approxSourcesLen, int approxJavadocLen,
|
|
517 |
String librarySHA1, String sourcesSHA1, String javadocSHA1) {
|
5fe7df
|
518 |
this.name = name;
|
JM |
519 |
this.group = group;
|
|
520 |
this.artifact = artifact;
|
|
521 |
this.version = version;
|
2a7306
|
522 |
this.approxLibraryLen = approxLibraryLen;
|
JM |
523 |
this.approxSourcesLen = approxSourcesLen;
|
|
524 |
this.approxJavadocLen = approxJavadocLen;
|
|
525 |
this.librarySHA1 = librarySHA1;
|
|
526 |
this.sourcesSHA1 = sourcesSHA1;
|
|
527 |
this.javadocSHA1 = javadocSHA1;
|
5fe7df
|
528 |
}
|
JM |
529 |
|
cf9550
|
530 |
private String getRepositoryPath(String jar) {
|
2a7306
|
531 |
return group + "/" + artifact + "/" + version + "/" + artifact + "-" + version + jar
|
JM |
532 |
+ ".jar";
|
5fe7df
|
533 |
}
|
JM |
534 |
|
cf9550
|
535 |
private File getLocalFile(String basePath, String jar) {
|
JM |
536 |
return new File(basePath, artifact + "-" + version + jar + ".jar");
|
|
537 |
}
|
|
538 |
|
|
539 |
private String getSHA1(String jar) {
|
|
540 |
if (jar.equals("")) {
|
2a7306
|
541 |
return librarySHA1;
|
cf9550
|
542 |
} else if (jar.equals("-sources")) {
|
2a7306
|
543 |
return sourcesSHA1;
|
cf9550
|
544 |
} else if (jar.equals("-javadoc")) {
|
2a7306
|
545 |
return javadocSHA1;
|
cf9550
|
546 |
}
|
2a7306
|
547 |
return librarySHA1;
|
cf9550
|
548 |
}
|
JM |
549 |
|
|
550 |
private int getApproximateLength(String jar) {
|
|
551 |
if (jar.equals("")) {
|
2a7306
|
552 |
return approxLibraryLen;
|
cf9550
|
553 |
} else if (jar.equals("-sources")) {
|
2a7306
|
554 |
return approxSourcesLen;
|
cf9550
|
555 |
} else if (jar.equals("-javadoc")) {
|
2a7306
|
556 |
return approxJavadocLen;
|
cf9550
|
557 |
}
|
2a7306
|
558 |
return approxLibraryLen;
|
5fe7df
|
559 |
}
|
JM |
560 |
|
|
561 |
@Override
|
|
562 |
public String toString() {
|
|
563 |
return name;
|
|
564 |
}
|
|
565 |
}
|
|
566 |
}
|