diff --git a/.gitignore b/.gitignore index 961baaa6..8a782aff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # TFM excludes build.properties -git.properties # Netbeans excludes /nbproject/private diff --git a/TotalFreedomMod.iml b/TotalFreedomMod.iml index 02d38e68..75e5765c 100644 --- a/TotalFreedomMod.iml +++ b/TotalFreedomMod.iml @@ -11,6 +11,7 @@ + @@ -59,7 +60,6 @@ - \ No newline at end of file diff --git a/pom.xml b/pom.xml index d51671ab..995dd1c1 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ ${maven.buildnumber} ${maven.build.timestamp} ${buildAuthor} - ${buildHead} + ${git.commit.id.abbrev} ${project.name} ${maven.build.timestamp} MM/dd/yyyy HH:mm @@ -198,6 +198,47 @@ + + + pl.project13.maven + git-commit-id-plugin + 2.2.4 + + + get-the-git-infos + + revision + + + + validate-the-git-infos + + validateRevision + + package + + + + ${project.basedir}/.git + git + yyyy-MM-dd HH:mm:ss + false + properties + false + false + + git.commit.id.abbrev + + + false + false + 7 + -dirty + * + + + + org.apache.maven.plugins @@ -205,16 +246,18 @@ 1.8 + default-cli initialize - + @@ -239,7 +282,7 @@ - ${basedir}/src/main/resources/build.properties + ${project.basedir}/src/main/resources/build.properties @@ -267,52 +310,6 @@ - - - pl.project13.maven - git-commit-id-plugin - 2.2.4 - - - get-the-git-infos - - revision - - - - validate-the-git-infos - - validateRevision - - package - - - - ${project.basedir}/.git - git - yyyy-MM-dd HH:mm:ss - false - true - ${basedir}/src/main/resources/git.properties - - properties - false - false - - git.build.time - git.commit.id - git.commit.id.abbrev - - - false - false - 7 - -dirty - * - - - - org.codehaus.mojo @@ -329,7 +326,7 @@ maven.buildnumber - ${basedir}/src/main/resources/build.properties + ${project.basedir}/src/main/resources/build.properties {0,number,#} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index c8c0c7e9..35e4e046 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -310,29 +310,13 @@ public class TotalFreedomMod extends AeroPlugin version = props.getProperty("buildVersion", pluginVersion); number = props.getProperty("buildNumber", "1"); date = props.getProperty("buildDate", "unknown"); + head = props.getProperty("buildHead", "unknown"); } catch (Exception ex) { FLog.severe("Could not load build properties! Did you compile with NetBeans/Maven?"); FLog.severe(ex); } - try - { - final Properties gitprops; - - try (InputStream in = plugin.getResource("git.properties")) - { - gitprops = new Properties(); - gitprops.load(in); - } - - head = gitprops.getProperty("git.commit.id.abbrev", "unknown"); - } - catch (Exception ex) - { - FLog.severe("Could not load Git properties! Is there a valid .git directory?"); - FLog.severe(ex); - } } public String formattedVersion()