Skip to content
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

deploy to azure artifacts #77

Open
schragnasher opened this issue Jan 30, 2023 · 4 comments
Open

deploy to azure artifacts #77

schragnasher opened this issue Jan 30, 2023 · 4 comments
Labels

Comments

@schragnasher
Copy link

I am attempting to deploy to azure artifacts with aether deploy as an alternative to the sbt deployer. The sbt deploy does not seem to work. Has anyone had success with aetherDeploy and azure repo? I keep getting unauthorized 401 errors, but I know the credentials are correct as I can deploy a normal maven java project just fine.

@yhvicey
Copy link

yhvicey commented Mar 28, 2023

Looks like when uploading jar file, plugin (or aether) will send an OPTIONS api call to https://pkgs.dev.azure.com/<org>/_packaging/<feed>/maven/v1/<pkg org>/<pkg name>/<pkg version>/<jar name> with credentials configured, which will return a 401 error.
And after receiving this 401 error, the following PUT call will not carry credentials configured - this looks more like aether behavior, I checked the source code and seems the plugin simply forwards deploy requests to underlying aether binary. Maybe need to create another issue in Aether repo (not sure how to call it - aether deploy tool?)

@yhvicey
Copy link

yhvicey commented Mar 28, 2023

Tried to use aetherCustomerHttpHeaders to force apply Basic auth for all requests but seems not working - @hamnis (sorry to ping you) Will Authorization header be ignored using this approach?

@StigLau
Copy link

StigLau commented Aug 11, 2023

Sounds like my problem of deploying to Gitlab Package Repo faces the same issue.
However, I know that first of all, my configuration of sbt/aether plugin is incorrect. Can you provide an example of how the aether plugin configuration should look like? Specifically for setting AetherKeys/aetherCustomHttpHeaders.

This is the gitlab/maven .m2/settings.xml config doc, which works for me

@hamnis
Copy link
Member

hamnis commented Aug 11, 2023

https://docs.gitlab.com/ee/user/packages/maven_repository/?tab=sbt

This should work with aether as well. This must be set for each project.

publishTo and credentials needs to be configured on the project

aetherCustomHttpHeaders needs to be set on each project.

def myConfigureProjects: (Project => Project) = _.settings(
  aetherCustomHttpHeaders := Map("Custom-header", "abc"),
  publishTo := Some("gitlab" at "https:://gitlab.com/foo"),
  credentials += credentials += Credentials("GitLab Packages Registry", "gitlab.com", "foo-deploy-token", "<token>")
)

lazy val p = project.configure(myConfigureProjects)

lazy val a = project.configure(myConfigureProjects)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants