1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package com.hazendaz.maven.makeself;
19
20 import java.io.IOException;
21 import java.io.InputStream;
22 import java.util.Properties;
23
24 import org.apache.maven.plugin.MojoFailureException;
25 import org.apache.maven.plugin.logging.Log;
26
27
28
29
30 public class PortableGit {
31
32
33 private String groupId;
34
35
36 private String artifactId;
37
38
39 private String version;
40
41
42 private String extension;
43
44
45 private String classifier;
46
47
48 private String name;
49
50
51
52
53
54
55 public String getGroupId() {
56 return groupId;
57 }
58
59
60
61
62
63
64 public String getArtifactId() {
65 return artifactId;
66 }
67
68
69
70
71
72
73 public String getVersion() {
74 return version;
75 }
76
77
78
79
80
81
82 public String getExtension() {
83 return extension;
84 }
85
86
87
88
89
90
91 public String getClassifier() {
92 return classifier;
93 }
94
95
96
97
98
99
100 public String getName() {
101 return name;
102 }
103
104
105
106
107
108
109
110
111
112
113 public PortableGit(final Log log) throws MojoFailureException {
114 try (InputStream input = this.getClass().getClassLoader().getResourceAsStream("META-INF/makeself.properties")) {
115 final Properties properties = new Properties();
116 properties.load(input);
117
118 this.groupId = properties.getProperty("portable.git.groupId");
119 this.artifactId = properties.getProperty("portable.git.artifactId");
120 this.version = properties.getProperty("portable.git.version");
121 this.extension = properties.getProperty("portable.git.extension");
122 this.classifier = properties.getProperty("portable.git.classifier");
123 this.name = properties.getProperty("portable.git.name");
124 } catch (final IOException e) {
125 log.error("Unable to read makeself.properties");
126 throw new MojoFailureException(e);
127 }
128 }
129
130 }