better versioning (#113)
This commit is contained in:
Родитель
f2c785abdf
Коммит
5c6c96cbb6
|
@ -107,8 +107,13 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.net.URISyntaxException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
|
||||
class Utils {
|
||||
|
||||
|
@ -108,6 +109,13 @@ class Utils {
|
|||
}
|
||||
|
||||
static String GetPackageVersion() {
|
||||
return Utils.class.getPackage().getImplementationVersion();
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
try (InputStream versionFileStream = Utils.class.getResourceAsStream("/app.properties")) {
|
||||
props.load(versionFileStream);
|
||||
return props.getProperty("version").trim();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
version=${project.version}
|
Загрузка…
Ссылка в новой задаче