All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.engineblock.cli.VersionInfo Maven / Gradle / Ivy

There is a newer version: 2.12.65
Show newest version
package io.engineblock.cli;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class VersionInfo {

    private final Properties versionProperties = new Properties();

    public VersionInfo() {
        InputStream versionStream = getClass().getResourceAsStream("/version.properties");
        try {
            versionProperties.load(versionStream);
        } catch (IOException e) {
            throw new RuntimeException("unable to read version properties:" + e);
        }
    }

    public String getVersion() {
        return versionProperties.getProperty("version");
    }

    public String getArtifactId() {
        return versionProperties.getProperty("artifactId");
    }

    public String getGroupId() {
        return versionProperties.getProperty("groupId");
    }

    public String getArtifactCoordinates() {
        return "\n" +
                " " + getGroupId() + "\n" +
                " "+ getArtifactId() + "\n" +
                " " + getVersion() + "\n" +
                "";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy