Skip to content

Commit 7f77d42

Browse files
authored
feat: remove version info file (#190)
* feat: remove version info file
1 parent 07b102c commit 7f77d42

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.aliyun.openservices</groupId>
1313
<artifactId>aliyun-log</artifactId>
14-
<version>0.6.133</version>
14+
<version>0.6.134</version>
1515
<packaging>jar</packaging>
1616

1717
<name>Aliyun LOG Java SDK</name>

src/main/java/com/aliyun/openservices/log/util/VersionInfoUtils.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@
77
* Unit test for VersionInfo.
88
*/
99
public class VersionInfoUtils {
10-
private static final String VERSION_INFO_FILE = "versioninfo.properties";
1110
private static final String USER_AGENT_PREFIX = "aliyun-log-sdk-java";
1211

13-
private static String version = null;
14-
1512
private static String defaultUserAgent = null;
1613

17-
public static String getVersion() {
18-
if (version == null) {
19-
initializeVersion();
20-
}
21-
return version;
22-
}
23-
2414
public static String getDefaultUserAgent() {
2515
if (defaultUserAgent == null) {
2616
String version = null;
@@ -30,25 +20,11 @@ public static String getDefaultUserAgent() {
3020
version = pkg.getImplementationVersion();
3121
}
3222
if (version == null) {
33-
version = getVersion();
23+
version = "unknown-version";
3424
}
3525
defaultUserAgent = USER_AGENT_PREFIX + "-" + version + "/" + System.getProperty("java.version");
3626
}
3727
return defaultUserAgent;
3828
}
3929

40-
private static void initializeVersion() {
41-
InputStream inputStream = VersionInfoUtils.class.getClassLoader().getResourceAsStream(VERSION_INFO_FILE);
42-
Properties versionInfoProperties = new Properties();
43-
try {
44-
if (inputStream == null) {
45-
throw new IllegalArgumentException(VERSION_INFO_FILE + " not found on classpath");
46-
}
47-
48-
versionInfoProperties.load(inputStream);
49-
version = versionInfoProperties.getProperty("version");
50-
} catch (Exception e) {
51-
version = "unknown-version";
52-
}
53-
}
5430
}

src/main/resources/versioninfo.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)