}
return url;
}
static URL createMavenGavURL(String artifactGav) throws MalformedURLException {
Artifact artifact = new DefaultArtifact(artifactGav);
if (artifact.getVersion() == null) {
throw new IllegalArgumentException("Null version");
}
VersionScheme versionScheme = new GenericVersionScheme();
try {
versionScheme.parseVersion(artifact.getVersion());
} catch (InvalidVersionSpecificationException e) {
throw new IllegalArgumentException(e);
}
try {
versionScheme.parseVersionRange(artifact.getVersion());
throw new IllegalArgumentException(artifact.getVersion() + " is a version range. A specific version is needed");
} catch (InvalidVersionSpecificationException expected) {
}
RepositorySystemSession session = newRepositorySystemSession();