Skip to content

Commit

Permalink
load library version via local ClassLoader (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-chew committed Oct 14, 2021
1 parent 722e25b commit fa56e7f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public static <V> V checkNotNull(final V ref, final String errMsg) {
public static String loadVersion() {
try {
final Properties properties = new Properties();
properties.load(ClassLoader.getSystemResourceAsStream("project.properties"));
final ClassLoader loader = Utils.class.getClassLoader();
properties.load(loader.getResourceAsStream("project.properties"));
return properties.getProperty("version");
} catch (final IOException ex) {
return "unknown";
Expand Down

0 comments on commit fa56e7f

Please # to comment.