// if we have exactly one artifact found
if (artifactSet.size() == 1) {
file = repository.getLocation((Artifact) artifactSet.first());
return file.getAbsoluteFile().toURL();
} else if (artifactSet.size() > 1) {// if we have more than 1 artifacts found use the latest one.
file = repository.getLocation((Artifact) artifactSet.last());
return file.getAbsoluteFile().toURL();
}
}
if (file == null) {
throw new DeploymentException("Missing artifact in repositories: " + artifactQuery.toString());