if (version == null) {
String message = String.format("Version for artifact %s:%s (%s) not specified, and no preference found in runtime configuration.", groupId, artifactId, classifier);
throw new RuntimeException(message);
}
ArtifactRef artifactRef = new RepoArtifactRef(groupId, artifactId, classifier, version);
// Check for double artifacts
for (ClasspathEntry entry : classpath) {
if (entry.getArtifactRef().equals(artifactRef)) {
log.error("Classloader specification contains second reference to same artifact, will skip second reference. Artifact = " + artifactRef);
continue classpath;
} else if (entry.getArtifactRef().getId().equals(artifactRef.getId())) {
log.warn("Classloader specification contains second reference to same artifact but different version. Artifact = " + artifactRef);
}
}
// Creating SharingMode