use of org.sonatype.aether.test.util.impl.StubVersion in project sonatype-aether by sonatype.
the class StubVersionRangeResolver method resolveVersionRange.
public VersionRangeResult resolveVersionRange(RepositorySystemSession session, VersionRangeRequest request) throws VersionRangeResolutionException {
String version = request.getArtifact().getVersion();
boolean range = false;
if (version.matches("\\[[^,]+,.*")) {
version = version.substring(1, version.indexOf(',', 1));
range = true;
}
VersionRangeResult result = new VersionRangeResult(request);
StubVersion ver = new StubVersion(version);
result.setVersions(Arrays.asList((Version) ver));
if (range && !request.getRepositories().isEmpty()) {
result.setRepository(ver, request.getRepositories().get(0));
}
return result;
}
Aggregations