fm-sbt-s3-resolver icon indicating copy to clipboard operation
fm-sbt-s3-resolver copied to clipboard

Failure to create a Resolver from an s3:// url with sbt 1.1.4 and v0.14.0

Open kolemannix opened this issue 6 years ago • 4 comments

It seems that the Resolver is being created before the plugin has a chance to register the UrlStreamHandler.

Details: plugins.sbt:

addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.14.0")

This line in build.sbt causes a crash:

resolvers += Resolver.url("LiveSafe", url("s3://s3.amazonaws.com/my-artifacts/ivy2"))(Resolver.ivyStylePatterns)

due to java.net.MalformedURLException: unknown protocol: s3. I do not see the s3:// UrlStreamHandler get installed.

However, if I do not try to add any s3 resolvers, I see the plugin registering the URL handler:

[info] Installing the s3:// URLStreamHandler via java.net.URL.setURLStreamHandlerFactory

If I then, later, via the console, add my s3 resolver, it succeeds.

kolemannix avatar Apr 23 '18 19:04 kolemannix

It worked when I created a project/project/plugins.sbt and added the plugin there.

kolemannix avatar Apr 23 '18 19:04 kolemannix

Just to clarify, you are trying to use the S3 Resolver to resolve SBT plugins which is why adding it to project/project/plugins.sbt worked?

tpunder avatar Jul 03 '18 14:07 tpunder

Nope, just to resolve dependencies at the project-level (not in the meta project).

kolemannix avatar Aug 10 '18 15:08 kolemannix

Hi, Same with my setup. Project level dependencies. Adding it to project/project/plugins.sbt fixes the issue. Otherwise, same java.net.MalformedURLException: unknown protocol: s3 using v0.19.0

gr211 avatar Oct 16 '19 11:10 gr211