public class OptionalExplicitDefaultArtifactResolver implements ArtifactResolver {
private final ArtifactResolver delegate;
public OptionalExplicitDefaultArtifactResolver(String versionMapLocation, Collection<ArtifactManager> artifactManagers, Collection<Repository> repositories, Collection<ServerInfo> serverInfos, Collection<ArtifactResolver> fallbackResolver) throws IOException {
ServerInfo serverInfo = getServerInfo(serverInfos);
if (serverInfo != null) {
delegate = new ExplicitDefaultArtifactResolver(versionMapLocation, getArtifactManager(artifactManagers), repositories, serverInfo);
} else {
if (fallbackResolver == null || fallbackResolver.isEmpty()) {
throw new IllegalStateException("No ServerInfo and no delegate ArtifactResolver supplied");