-
Notifications
You must be signed in to change notification settings - Fork 931
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
Publishing to Sonatype Nexus repository doesn't work in sbt-1.0.0-x #3331
Comments
I think @marsxu1984 is running into the same issue (when trying to publish to an Artifactory repo). He reports that the same issue occurs in 1.0.0-M6, while 1.0.0-M5 works. Start of the conversation: https://gitter.im/sbt/sbt?at=597082dabf7e6af22cf81123. |
My guess is that this is due to Gigahorse. |
I was able to reproduce it myself using an old scopt build (https://github.com/eed3si9n/scopt/tree/wip/350). sbt:scopt> publishSigned
[info] Wrote /Users/eed3si9n/work/scopt/target/scala-2.11/scopt_2.11-3.5.0-SNAPSHOT.pom
[error] java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2.11/3.5.0-SNAPSHOT/scopt_2.11-3.5.0-SNAPSHOT-sources.jar.asc was refused by the server: Unauthorized
[error] at org.apache.ivy.util.url.AbstractURLHandler.validatePutStatusCode(AbstractURLHandler.java:79)
[error] (*:publishSigned) java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2.11/3.5.0-SNAPSHOT/scopt_2.11-3.5.0-SNAPSHOT-sources.jar.asc was refused by the server: Unauthorized |
There are some pains in using Bintray (because its repository can be down for several hours). We also need to use private repositories (e.g., Artifactory as @marsxu1984 reported). I'd appreciate if this bug can be fixed. (I've tried to check the corresponding code but sbt has many components, and it was difficult for me to identify the cause) |
Yes. We can't ship another RC until we fix this bug. |
Fixes sbt/sbt#3331 The siatuation is a bit complicated. Currently the credentials are stored in Ivy's credential store. This needs to be translated into `java.net.Authenticator` by installing `IvyAuthenticator` and `ErrorMessageAuthenticator` in succession. This, then, needs to be translated into OkHttp Authenticator using `okhttp3.JavaNetAuthenticator`.
Fixed in sbt/librarymanagement#141. This will be in next RC. |
steps
$(HOME)/.sbt/1.0/sonatype.sbt
https://github.com/xerial/sbt-sonatype/tree/support-1.0.0-M2#homesbtsbt-versionsonatypesbt-- Or write the credential configuration in build.sbt
problem
It seems Sonatype credential configuration is not effective, and
publish
fails with an authentication failure:expectation
The same configuration works if I use sbt 0.13.x. This is a blocker for releasing https://github.com/xerial/sbt-sonatype for sbt-1.0.0-RC2.
notes
sbt version: 1.0.0-RC2
I found the configuration in ~/.sbt/1.0/*.sbt is loaded (for example, the other key set in this file can be seen in sbt console) but it seems the credential is not used when running
publish
command.The text was updated successfully, but these errors were encountered: