1 |
|
import java.io.IOException; |
2 |
|
import java.text.ParseException; |
3 |
|
import java.text.SimpleDateFormat; |
4 |
|
|
5 |
|
import org.apache.commons.lang.StringUtils; |
6 |
|
|
|
|
| 0% |
Uncovered Elements: 42 (42) |
Complexity: 9 |
Complexity Density: 0.27 |
|
7 |
|
public class Deploy { |
8 |
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd.hhmmss"); |
9 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
10 |
0
|
public static void main(final String[] args) {... |
11 |
0
|
Deploy deploy = new Deploy(); |
12 |
0
|
deploy.run(); |
13 |
|
} |
14 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
15 |
0
|
public void run() {... |
16 |
0
|
try { |
17 |
0
|
String url = getCurlUrl(); |
18 |
0
|
System.out.println("\n" + url); |
19 |
|
} catch (Throwable t) { |
20 |
0
|
t.printStackTrace(); |
21 |
|
} |
22 |
|
} |
23 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
24 |
0
|
protected String getCurlUrl() throws Exception {... |
25 |
0
|
return null; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
} |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 2 |
Complexity Density: 0.15 |
|
33 |
0
|
protected String getFilename(final BuildInfo bi) {... |
34 |
0
|
StringBuffer sb = new StringBuffer(); |
35 |
0
|
sb.append(bi.getArtifactId()); |
36 |
0
|
sb.append("-"); |
37 |
0
|
String version = bi.getVersion(); |
38 |
0
|
if (version.endsWith("-SNAPSHOT")) { |
39 |
0
|
version = StringUtils.replace(version, "-SNAPSHOT", ""); |
40 |
|
} |
41 |
0
|
sb.append(version); |
42 |
0
|
sb.append("-"); |
43 |
0
|
sb.append(sdf.format(bi.getTimestamp())); |
44 |
0
|
sb.append("-"); |
45 |
0
|
sb.append(bi.getBuildNumber()); |
46 |
0
|
sb.append(".war"); |
47 |
0
|
return sb.toString(); |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
|
50 |
0
|
protected BuildInfo getBuildInfo(final String contents) throws ParseException {... |
51 |
0
|
String artifactId = StringUtils.substringBetween(contents, "<artifactId>", "</artifactId>"); |
52 |
0
|
String version = StringUtils.substringBetween(contents, "<version>", "</version>"); |
53 |
0
|
String buildNumber = StringUtils.substringBetween(contents, "<buildNumber>", "</buildNumber>"); |
54 |
0
|
String timestamp = StringUtils.substringBetween(contents, "<timestamp>", "</timestamp>"); |
55 |
|
|
56 |
0
|
BuildInfo bi = new BuildInfo(); |
57 |
0
|
bi.setArtifactId(artifactId); |
58 |
0
|
bi.setVersion(version); |
59 |
0
|
bi.setBuildNumber(new Integer(buildNumber)); |
60 |
0
|
bi.setTimestamp(sdf.parse(timestamp)); |
61 |
0
|
return bi; |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
64 |
0
|
protected String getUrl(final String filename) {... |
65 |
0
|
String base = "http://maven.kuali.org/snapshot/org/kuali/student/web/ks-embedded/1.1.0-M9-SNAPSHOT/"; |
66 |
0
|
return base + filename; |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0
|
protected String getContents(final String url) throws IOException { ... |
70 |
0
|
return null; |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
} |
76 |
|
|
77 |
|
} |