[MNG-7968] Expose Maven Version as Version (not String) (#1346)

Change existing API to expose Version instead of String.

---

https://issues.apache.org/jira/browse/MNG-7968
This commit is contained in:
Tamas Cservenak 2023-12-18 10:56:08 +01:00 committed by GitHub
parent ab09661c64
commit 84a48a8bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -77,7 +77,7 @@ public interface Session {
* @return the maven version, never {@code null}
*/
@Nonnull
String getMavenVersion();
Version getMavenVersion();
int getDegreeOfConcurrency();

View File

@ -29,13 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import org.apache.maven.RepositoryUtils;
import org.apache.maven.api.DependencyCoordinate;
import org.apache.maven.api.LocalRepository;
import org.apache.maven.api.Project;
import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.Service;
import org.apache.maven.api.Session;
import org.apache.maven.api.SessionData;
import org.apache.maven.api.*;
import org.apache.maven.api.annotations.Nonnull;
import org.apache.maven.api.annotations.Nullable;
import org.apache.maven.api.services.MavenException;
@ -124,8 +118,8 @@ public class DefaultSession extends AbstractSession {
@Nonnull
@Override
public String getMavenVersion() {
return runtimeInformation.getMavenVersion();
public Version getMavenVersion() {
return parseVersion(runtimeInformation.getMavenVersion());
}
@Override