diff --git a/ivy/src/main/scala/sbt/Ivy.scala b/ivy/src/main/scala/sbt/Ivy.scala index a938087fd..5d30520da 100644 --- a/ivy/src/main/scala/sbt/Ivy.scala +++ b/ivy/src/main/scala/sbt/Ivy.scala @@ -314,6 +314,7 @@ private object IvySbt // the common case is for resolved.getArtifactResolver to be inter-project from a different project's publish-local // if there are problems with this, a less aggressive fix might be to only reset the artifact resolver when it is a ProjectResolver // a possible problem is that fetching artifacts is slower, due to the full chain being the artifact resolver instead of the specific resolver + // This also fixes #760, which occurs when metadata exists in a repository, but the artifact doesn't. private[this] def resetArtifactResolver(resolved: ResolvedModuleRevision): ResolvedModuleRevision = if(resolved eq null) null diff --git a/sbt/src/sbt-test/dependency-management/metadata-only-resolver/build.sbt b/sbt/src/sbt-test/dependency-management/metadata-only-resolver/build.sbt new file mode 100644 index 000000000..98e8b7518 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/metadata-only-resolver/build.sbt @@ -0,0 +1,6 @@ +ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / ".ivy2"))) + +// not in the default repositories +libraryDependencies += "com.sun.jmx" % "jmxri" % "1.2.1" + +autoScalaLibrary := false \ No newline at end of file diff --git a/sbt/src/sbt-test/dependency-management/metadata-only-resolver/test b/sbt/src/sbt-test/dependency-management/metadata-only-resolver/test new file mode 100644 index 000000000..7e3c3e698 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/metadata-only-resolver/test @@ -0,0 +1,6 @@ +# should fail because the dependency is not in the default repositories +-> update + +# add a repository with the dependency, which should then succeed +> 'set resolvers += "Nuxeo" at "http://maven.nuxeo.org/nexus/content/groups/public/"' +> update \ No newline at end of file