Skip to content

Commit 567740c

Browse files
committed
Add url
1 parent e093615 commit 567740c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ratis-common/src/main/java/org/apache/ratis/util/VersionInfo.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class VersionInfo {
4343
private static final String FORMAT = " %20s: %s";
4444

4545
private enum Key {
46-
NAME, VERSION, REVISION;
46+
NAME, VERSION, REVISION, URL, JAVA_VERSION;
4747

4848
static Key parse(String key) {
4949
for (Key k : Key.values()) {
@@ -108,6 +108,7 @@ private VersionInfo(Class<?> clazz, Properties properties) {
108108
}
109109
}
110110

111+
cores.put(Key.JAVA_VERSION, System.getProperty("java.version"));
111112
this.coreEntries = new KeyMap(cores);
112113
this.otherEntries = Collections.unmodifiableMap(others);
113114
}
@@ -118,6 +119,7 @@ public void printStartupMessages(Object name, Consumer<String> log) {
118119
, coreEntries.getOrDefault(Key.NAME), clazz.getSimpleName(), name));
119120
log.accept(coreEntries.format(Key.VERSION));
120121
log.accept(coreEntries.format(Key.REVISION));
122+
log.accept(coreEntries.format(Key.URL));
121123

122124
for (Map.Entry<String, String> e : otherEntries.entrySet()) {
123125
log.accept(String.format(FORMAT, e.getKey(), e.getValue()));

src/main/resources/ratis-version.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
name=${project.name}
1919
version=${project.version}
2020
revision=${version-info.scm.commit}
21+
url=${version-info.scm.uri}

0 commit comments

Comments
 (0)