mirror of https://github.com/sbt/sbt.git
Merge pull request #1996 from sbt/wip/fix-aether-resolver
Fix issue with aether resolver and bad URLs.
This commit is contained in:
commit
038437587b
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue