Reputation: 3168
I can't figure why sbt reacts this way. I defined multiple resolvers this way:
resolvers += "osgeo" at "http://download.osgeo.org/webdav/geotools/"
resolvers += "boundless" at "http://repo.boundlessgeo.com/main"
resolvers += "geotoolkit" at "http://maven.geotoolkit.org/"
And added geotools dependencies:
val gtReferencing = "org.geotools" % "gt-referencing" % "20.1"
val gtGeometry = "org.geotools" % "gt-geometry" % "20.1"
val geotools = Seq(gtReferencing, gtGeometry)
lazy val projectData = (project in file("."))
.settings(
name := "project",
libraryDependencies ++= geotools,
....
Sometimes maven.geotoolkit.org is down, in my understand sbt should try with other repo (osgeo has the dependencies), but it breaks all download, it returns me a lot of such errors:
[error] Resolution failed several times for dependency: com.github.fommil.netlib#parent;1.1 {}::
[error] geotoolkit: unable to get resource for com/github/fommil/netlib#parent;1.1: res=http://maven.geotoolkit.org/com/github/fommil/netlib/parent/1.1/parent-1.1.jar: java.net.ConnectException: Failed to connect to maven.geotoolkit.org/193.54.123.160:80
[error] geotoolkit: unable to get resource for com/github/fommil/netlib#parent;1.1: res=http://maven.geotoolkit.org/com/github/fommil/netlib/parent/1.1/parent-1.1.pom: java.net.ConnectException: Failed to connect to maven.geotoolkit.org/193.54.123.160:80
[error]
[error] geotoolkit: unable to get resource for com/github/fommil/netlib#core;1.1.2: res=http://maven.geotoolkit.org/com/github/fommil/netlib/core/1.1.2/core-1.1.2.pom: java.net.ConnectException: Failed to connect to maven.geotoolkit.org/193.54.123.160:80
[error]
[error] unresolved dependency: org.apache.commons#commons-math3;3.2: Resolution failed several times for dependency: org.apache.commons#commons-math3;3.2 {compile=[compile(*), master(compile)], runtime=[runtime(*)]}::
[error] Resolution failed several times for dependency: org.apache.commons#commons-parent;28 {}::
[error] Resolution failed several times for dependency: org.apache#apache;13 {}::
...
Is there no way to not break when a repo is down, and try with the others?
Upvotes: 0
Views: 342
Reputation: 497
You are right, it should try all the repos if lib is not found or repo is not available. It's complaining about the org.apache.commons library which is not available in http://download.osgeo.org/webdav/geotools. It should however be available in quite a few public maven repos: https://mvnrepository.com/artifact/org.apache.commons/commons-math3/3.2
Sbt:s default maven repo should also have it, but I don't know if it's maybe disabled in your environment. You can explicitly try to add it via
resolvers += DefaultMavenRepository
// or try one of the other predefined repositories like
resolvers += JavaNet2Repository
// or if you are using sbt 0.13
resolvers += JavaNet1Repository
Upvotes: 0