Skip to content

Commit 49c8be4

Browse files
authored
fix: read project properties from package's own ClassLoader (#269)
Co-authored-by: Adam Freidin <[email protected]>
1 parent 275ce52 commit 49c8be4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/amazonaws/encryptionsdk/internal/VersionInfo.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public class VersionInfo {
2626
public static String loadUserAgent() {
2727
try {
2828
final Properties properties = new Properties();
29-
properties.load(ClassLoader.getSystemResourceAsStream("project.properties"));
29+
final ClassLoader loader = VersionInfo.class.getClassLoader();
30+
properties.load(loader.getResourceAsStream("project.properties"));
3031
return USER_AGENT_PREFIX + properties.getProperty("version");
3132
} catch (final IOException ex) {
3233
return USER_AGENT_PREFIX + UNKNOWN_VERSION;

0 commit comments

Comments
 (0)