diff --git a/pom.xml b/pom.xml index 22c55e9..b918fc1 100644 --- a/pom.xml +++ b/pom.xml @@ -224,5 +224,11 @@ + + + src/main/resources + true + + diff --git a/src/main/java/no/nav/fpsak/nare/evaluation/summary/NareVersion.java b/src/main/java/no/nav/fpsak/nare/evaluation/summary/NareVersion.java new file mode 100644 index 0000000..24a22d8 --- /dev/null +++ b/src/main/java/no/nav/fpsak/nare/evaluation/summary/NareVersion.java @@ -0,0 +1,25 @@ +package no.nav.fpsak.nare.evaluation.summary; + +import java.util.Properties; + +public class NareVersion { + + private NareVersion() { + } + + public static final EvaluationVersion NARE_VERSION = readVersionPropertyFor("nare", "nare/nare-version.properties"); + + + public static EvaluationVersion readVersionPropertyFor(String projectName, String propertiesFile) { + String version; + try { + final Properties properties = new Properties(); + properties.load(NareVersion.class.getClassLoader().getResourceAsStream(propertiesFile)); + version = properties.getProperty("version"); + } catch (Exception e) { + version = "UNKNOWN"; + } + return new EvaluationVersion(projectName, version); + } + +} diff --git a/src/main/resources/nare/nare-version.properties b/src/main/resources/nare/nare-version.properties new file mode 100644 index 0000000..e5683df --- /dev/null +++ b/src/main/resources/nare/nare-version.properties @@ -0,0 +1 @@ +version=${project.version} \ No newline at end of file