Fix issue with aether resolver and bad URLs.

It appears like the change to use the new MRID when checking for JAR was not applied before merge.
This commit is contained in:
Josh Suereth 2015-04-28 17:28:26 -04:00
parent 27bd275343
commit 0b26b8b801
1 changed files with 5 additions and 5 deletions

View File

@ -234,12 +234,12 @@ abstract class MavenRepositoryResolver(settings: IvySettings) extends AbstractRe
m m
} }
final def checkJarArtifactExists(dd: DependencyDescriptor): Boolean = { final def checkJarArtifactExists(dd: ModuleRevisionId): Boolean = {
// TODO - We really want this to be as fast/efficient as possible! // TODO - We really want this to be as fast/efficient as possible!
val request = new AetherArtifactRequest() val request = new AetherArtifactRequest()
val art = new AetherArtifact( val art = new AetherArtifact(
aetherCoordsFromMrid(dd.getDependencyRevisionId, "jar"), aetherCoordsFromMrid(dd, "jar"),
getArtifactProperties(dd.getDependencyRevisionId)) getArtifactProperties(dd))
request.setArtifact(art) request.setArtifact(art)
addRepositories(request) addRepositories(request)
try { try {
@ -266,7 +266,7 @@ abstract class MavenRepositoryResolver(settings: IvySettings) extends AbstractRe
case "pom" => case "pom" =>
// THere we have to attempt to download the JAR and see if it comes, if not, we can punt. // THere we have to attempt to download the JAR and see if it comes, if not, we can punt.
// This is because sometimes pom-packaging attaches a JAR. // This is because sometimes pom-packaging attaches a JAR.
if (checkJarArtifactExists(dd)) { if (checkJarArtifactExists(drid)) {
val defaultArt = val defaultArt =
new DefaultArtifact(md.getModuleRevisionId, new Date(lastModifiedTime), artifactId, packaging, "jar") new DefaultArtifact(md.getModuleRevisionId, new Date(lastModifiedTime), artifactId, packaging, "jar")
md.addArtifact(MavenRepositoryResolver.DEFAULT_ARTIFACT_CONFIGURATION, defaultArt) md.addArtifact(MavenRepositoryResolver.DEFAULT_ARTIFACT_CONFIGURATION, defaultArt)
@ -274,7 +274,7 @@ abstract class MavenRepositoryResolver(settings: IvySettings) extends AbstractRe
case JarPackaging() => case JarPackaging() =>
// Here we fail the resolution. This is an issue when pom.xml files exist with no JAR, which happens // Here we fail the resolution. This is an issue when pom.xml files exist with no JAR, which happens
// on maven central for some reason on old artifacts. // on maven central for some reason on old artifacts.
if (!checkJarArtifactExists(dd)) if (!checkJarArtifactExists(drid))
throw new MavenResolutionException(s"Failed to find JAR file associated with $dd") throw new MavenResolutionException(s"Failed to find JAR file associated with $dd")
// Assume for now everything else is a jar. // Assume for now everything else is a jar.
val defaultArt = val defaultArt =