[MNG-7971] Add Artifact#getBaseVersion (#1345)

This commit is contained in:
Guillaume Nodet 2023-12-15 16:48:33 +01:00 committed by GitHub
parent 3c65873b58
commit eec44b4ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -73,6 +73,14 @@ public interface Artifact {
@Nonnull
Version getVersion();
/**
* The base version of the artifact.
*
* @return the version
*/
@Nonnull
Version getBaseVersion();
/**
* The classifier of the artifact.
*

View File

@ -75,6 +75,11 @@ public class DefaultArtifact implements Artifact {
return session.parseVersion(artifact.getVersion());
}
@Override
public Version getBaseVersion() {
return session.parseVersion(artifact.getBaseVersion());
}
@Nonnull
@Override
public String getExtension() {

View File

@ -86,6 +86,11 @@ public class DefaultDependency implements Dependency {
return session.parseVersion(dependency.getArtifact().getVersion());
}
@Override
public Version getBaseVersion() {
return session.parseVersion(dependency.getArtifact().getBaseVersion());
}
@Override
public String getExtension() {
return dependency.getArtifact().getExtension();