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
Can't use Microsoft Azure DevOps Maven Repository as Resolver #5492
Comments
For the record, I think the publishing side will be fixed by sbt/ivy#36. |
@eed3si9n I open a ticket with as well Coursier coursier/coursier#1649 |
In order to make it work with sbt 1.3.10 you have to create a
If you do use a file just let |
@mantovani checked out the url response headers and the realm is reported as |
As stated in sbt#5492 and sbt#2366 some artifact hosting services (at least Azure Artifacts, seems to affect GCP as well) do not offer a stable HTTP Auth realm that can be safely set in SBT credentials, hence the need to support null or empty Credentials. The Ivy (publishing) side of the issue was fixed in sbt/ivy#36 As to the resolving side, This commit is only part of the solution as it just prevents an NPE and does not consider if coursier itself will fall back to finding credentials with a null realm that matches the server hostname. Related-to: sbt#5492 Related-to: sbt#2366 Signed-off-by: Erwan Queffelec <erwan.queffelec@gmail.com>
I attempted to tackle this issue and found that even if the HTTP realm is an I'm still unsure it needs any work on upstream coursier as stated in coursier/coursier#1649, see my latest comment in #5483... There might be an User Agent issue here as well. I tried logging UA from coursier HTTP requests, it sets the UA header with an empty value, I'll try to set it to |
Still have this problem for sbt > 1.2.8 |
The problem seems to be in the default coursier configuration.
This snippet manually adds authentication information to resolution requests towards Azure Artifacts servers. The checksum error occurs because Azure Artifacts sometimes returns an HTTP 203 response. Coursier treats 2XX response codes as successes so even if you disable the checksum checking you still get some SAX exception with no stacktrace in the error log. |
I'm dealing with this problem myself. Unfortunately I tried the snippet above with sbt 1.5.5, and it didn't seem to help. I do notice that my organization has a "(orgname).pkgs.visualstudio.com" host instead, and swapped it out as the repo host, but no joy. |
I'm dealing with right now as well. But for me edit: .settings(
csrConfiguration := { ..
},
updateClassifiers / csrConfiguration := csrConfiguration.value
} |
Hello, This issue is still happening for us, and it's really annoying. What fixes it for us is including this
Before
But depending on |
To add extra details, this solution DOES NOT work: // Does not work for us
.settings(
csrConfiguration := {
// ...
},
updateClassifiers / csrConfiguration := csrConfiguration.value
} |
One more — adding the sbt-coursier plugin fixes the problem, but there's an extra problem ... The |
This is still a problem for us. Unable to publish jar to Azure DevOps from SBT> Any alternative ways to deal with it? |
Using the above I'm able to successfully download artefacts from an ADO Maven repository.
The addition to the EDIT: Fetching sources was fixed by adding the following to the Coursier config:
|
That is interesting because that is exactly how we use it to make it able to download sources. Without it it lacks the proper settings. |
The below worked for me in the interim: https://github.com/arktekk/sbt-aether-deploy # Use 0.26.0 for JDK8. I think the versions above that use JDK11
addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % "0.26.0") Able to push using the above plugin and following settings:
|
I am having issues publishing to an azure feed, but different. I get
I can publish a regular maven project just fine, but sbt is giving me problems.
|
Can we get help on this, please? Still unable to publish the Azure DevOps Maven repository and seeing the below error: |
This still keeps happening. The solution seems to be to set the ThisBuild / credentials += {
// https://github.com/sbt/sbt/issues/5492#issuecomment-614492826
val file = Path(sys.env.getOrElse("SBT_CREDENTIALS_PATH", Path.userHome.toString)) / ".sbt" / ".credentials"
val props = new java.util.Properties()
props.load(new java.io.FileInputStream(file))
Credentials(
realm = null,
host = props.getProperty("host"),
userName = props.getProperty("user"),
passwd = props.getProperty("password")
)
} |
This does not help with my issue, I am using a null/empty realm in the creds file. Still get too many redirects, and aether deploy continually give unauthorized even when i knew the creds are good from publishing other maven projects. |
Ref #2366
Ref #5264
steps
Add a Microsoft Azure DevOps Maven repository as resolver with Coursier throws:
sbt version
The checksum actually has a HTML from Azure:
If I turn off Coursier
ThisBuild / useCoursier := false
I have the following error from ivy:The text was updated successfully, but these errors were encountered: