![JAR search and dependency download from the Maven repository](/logo.png)
io.github.chains_project.maven_lockfile.data.Environment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-lockfile Show documentation
Show all versions of maven-lockfile Show documentation
This plugin is a state-of-the-art solution that can be used to validate the integrity
of a maven repository.
It does this by generating a lock file that contains the checksums of all the artifacts in the
repository.
The lock file can then be used to validate the integrity of the repository.
This guards the supply chain against malicious actors that might tamper with the artifacts in
the repository.
package io.github.chains_project.maven_lockfile.data;
import java.util.Objects;
/**
* Metadata about the environment in which the lock file was generated. This includes the OS name, the Maven version and the Java version.
*/
public class Environment {
private final String osName;
private final String mavenVersion;
private final String javaVersion;
public Environment(String osName, String mavenVersion, String javaVersion) {
this.osName = osName;
this.mavenVersion = mavenVersion;
this.javaVersion = javaVersion;
}
/**
* @return the java version of the environment in which the lock file was generated
*/
public String getJavaVersion() {
return javaVersion;
}
/**
* @return the mavenVersion of the environment in which the lock file was generated
*/
public String getMavenVersion() {
return mavenVersion;
}
/**
* @return the osName of the environment in which the lock file was generated
*/
public String getOsName() {
return osName;
}
@Override
public String toString() {
return "Metadata [osName=" + osName + ", mavenVersion=" + mavenVersion + ", javaVersion=" + javaVersion + "]";
}
@Override
public int hashCode() {
return Objects.hash(osName, mavenVersion, javaVersion);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Environment)) {
return false;
}
Environment other = (Environment) obj;
return Objects.equals(osName, other.osName)
&& Objects.equals(mavenVersion, other.mavenVersion)
&& Objects.equals(javaVersion, other.javaVersion);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy