Skip to content

Commit ece99ee

Browse files
Add host name/address, or null on exception
1 parent 8ae6d92 commit ece99ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/pl/project13/maven/git/GitCommitIdMojo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,11 @@ void loadBuildTimeData(@NotNull Properties properties) {
477477
}
478478

479479
void loadBuildHostData(@NotNull Properties properties) {
480-
String buildHost;
480+
String buildHost = null;
481481
try {
482-
buildHost = InetAddress.getLocalHost().getHostName();
482+
buildHost = InetAddress.getLocalHost().toString();
483483
} catch (UnknownHostException e) {
484-
buildHost = "UNKNOWN";
484+
log("Unable to get build host");
485485
}
486486
put(properties, BUILD_HOST, buildHost);
487487
}

0 commit comments

Comments
 (0)