com.saucelabs.visual.utils.ArtifactVersion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Java library to interact with Sauce Visual
The newest version!
package com.saucelabs.visual.utils;
import java.util.Optional;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ArtifactVersion {
private static final Logger log = LoggerFactory.getLogger(ArtifactVersion.class);
public static Optional getArtifactVersion() {
try {
Properties props = new Properties();
props.load(
ArtifactVersion.class
.getClassLoader()
.getResourceAsStream("com/saucelabs/visual/utils/pom.properties"));
return Optional.of(props.getProperty("version"));
} catch (Exception e) {
log.error("unable to parse version from jar", e);
}
return Optional.empty();
}
}