Skip to content

Commit

Permalink
Fix #365: do not fail if build without git info or git plugin disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Oct 16, 2024
1 parent db8b9f2 commit efc4711
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/src/main/java/pro/javacard/gp/GPSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ public static GPSession connect(APDUBIBO channel, AID sdAID) throws IOException,
public static String getVersion() {
Properties prop = new Properties();
try (InputStream versionfile = GPSession.class.getResourceAsStream("git.properties")) {
// if built from targzip and/or with -Dmaven.gitcommitid.skip=true
if (versionfile == null) {
return "unsupported";
}
prop.load(versionfile);
return prop.getProperty("git.commit.id.describe", "unknown-development");
} catch (IOException e) {
Expand Down

0 comments on commit efc4711

Please sign in to comment.