r.josp.jcpGWs.2.2.0.source-code.BuildInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcpGWs Show documentation
Show all versions of jcpGWs Show documentation
This is the JCP Gateway executable from John O.S. Project
package com.robypomper;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
import java.io.InputStream;
public class BuildInfo {
public final static BuildInfo current = load();
public String project;
public String sourceSet;
public String version;
public String versionBuild;
public Date buildTime;
public String javaVersion;
public String javaHome;
public String gradleVersion;
public String gitCommit;
public String gitCommitShort;
public String gitBranch;
public String user;
public String osName;
public String osVersion;
public String osArch;
public Map extra;
private static BuildInfo load() {
InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream("buildInfo.json");
if (resource == null) {
throw new IllegalArgumentException("File 'buildInfo.json' not found");
}
try {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(resource, BuildInfo.class);
} catch (IOException e) {
throw new IllegalArgumentException("Error parsing file", e);
}
}
}