-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.UnsupportedOperationException with 0.12.0 and sbt 1.0.0 / 1.0.1 #38
Comments
I'm seeing this behaviour as well - blocker for upgrading my projects to sbt 1.0.x at the moment |
Seeing the same issue, not sure what to do... |
I played around with SBT 1.0 a little bit when it came out and ran into some issues (not sure if they were SBT 1.0 issues or issues with this plugin) and just haven't circled back yet. I'll see if I can find time to try upgrading all my projects to SBT 1.0 again and make this this plugin works right. |
I'm attempting to upgrade some projects to SBT 1.0.2 and am able to repro the issue |
The Exception comes from here: https://github.com/apache/ant-ivy/blob/master/src/java/org/apache/ivy/util/url/BasicURLHandler.java#L273 @Override
public void upload(final File src, final URL dest, final CopyProgressListener listener,
final TimeoutConstraint timeoutConstraint) throws IOException {
if (!"http".equals(dest.getProtocol()) && !"https".equals(dest.getProtocol())) {
throw new UnsupportedOperationException(
"URL repository only support HTTP PUT at the moment");
}
That seems to mean it's not going through the S3URLHandler: https://github.com/frugalmechanic/fm-sbt-s3-resolver/blob/master/src/main/scala/fm/sbt/S3URLHandler.scala |
It's possible SBT is wiping out the s3 handler that gets registered with Ivy here: https://github.com/sbt/librarymanagement/blob/480a1a366ddd69e4179fb097eb84163a1ffbf42f/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala#L91-L92 |
Only the publishing part is impacted. publish := {
def upload(file: File, repo: String) = {
val artifactName = file.getName.split("-").head
val dest = s"$repo/${organization.value.replace(".", "/")}/$artifactName/${version.value}/${file.getName}"
s"aws s3 cp ${file.getAbsolutePath} $dest".!
}
val repo = "s3://my-repositories/path"
upload((packageBin in Compile).value, repo)
upload(makePom.value, repo)
} Works also with cross compiled projects like ScalaJS |
I have pull request for https://github.com/sbt/librarymanagement that fixes this: sbt/librarymanagement#183 |
I see sbt 1.0.4 got released with my sbt/librarymanagement fix. Anybody test it out yet? |
Yes it works! Thanks so much! |
Publish fails with Sbt 1.0.0 and 1.0.1 fail with release 0.12.0 but works with sbt 0.13.16. Resolving works with 0.12.0 and sbt 1.0.1
stack trace for 0.12.0 and sbt 1.0.1 ...
The text was updated successfully, but these errors were encountered: