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

Publish to Maven Central with new interface #465

Closed
Tammo0987 opened this issue Jan 25, 2024 · 14 comments
Closed

Publish to Maven Central with new interface #465

Tammo0987 opened this issue Jan 25, 2024 · 14 comments

Comments

@Tammo0987
Copy link

Hello,
I am asking for help. Since it seems like, that the old Jira from Sonatype will be shutdown and only https://central.sonatype.com will be used. I wanted to ask if I can get currently the plugin running with an user token created from the new interface and how I should configure it.

When I use s01.oss.sonatype.org as described, I get an error for to many redirects.

@rlemaitre
Copy link

I've the same issue. I cannot publish to central.sonatype.org due to too many redirect errors

@xerial
Copy link
Owner

xerial commented Feb 2, 2024

I wasn't aware of this change: https://central.sonatype.org/register/central-portal/#switching-to-ossrh-during-portal-early-access. In fact, I don't know much about this change and I don't have an account on the new http://central.sonatype.org/ to test it.

It seems Sonatype has renewed almost all steps to register new domains, so I also need to relearn everything from scratch, including its API and token management 😓

@xerial
Copy link
Owner

xerial commented Feb 2, 2024

If you can identify what needs to be fixed in sbt-sonatype and highlight the necessary code changes (for example, a pull request), I would appreciate it. I can create a new release soon.

@windymelt
Copy link

Almost same issue here (encountered by using sbt-typelevel). Sonatype says they provide new API for publishing artifacts. We may use new endpoint, new API.

I'll check code anyway :)

@xerial
Copy link
Owner

xerial commented Feb 5, 2024

It looks like a big change and more automation has been added on the sonatype side 😮 https://central.sonatype.org/publish/publish-portal-api/

@xerial
Copy link
Owner

xerial commented Feb 5, 2024

At first glance, it looks like a huge improvement. I'd like to support the new https://central.sonatype.com/ API in sbt-sonatype 4.x

@windymelt
Copy link

According to the documentation, it is no longer possible to create a new account on the old system, so Scala library author who recently created an account on the new system are effectively unable to publish libraries (except hand-made publish process).

@Andrapyre
Copy link
Contributor

Andrapyre commented Feb 27, 2024

See the following PR for an initial implementation that offers Sonatype Central support: #474

@Andrapyre
Copy link
Contributor

For users needing immediate support to publish libraries, the following is a temporary workaround:

  1. Download the changes in feature: Support the new Sonatype Central API #474.
  2. Run
sbt "compile; publishLocal"
  1. Copy the package id from the output: <User Dir>/.ivy2/local/org.xerial.sbt/sbt-sonatype/scala_2.12/sbt_1.0/<package-id>/ivys/ivy.xml
  2. Go to your project, checkout a new branch, and add the following to plugins.sbt :
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "<package-id>")
  1. In your project, add the following to your build.sbt:
import xerial.sbt.Sonatype.sonatypeCentralHost

ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
ThisBuild / version := "<target version>"
  1. Generate credentials in Sonatype Central and add them to your .zsh like so:
export SONATYPE_USERNAME="<sonatype_username>"
export SONATYPE_PASSWORD="<sonatype_password>"
  1. If you have not already done so, follow the instructions here to set up GPG.
  2. Run the following and paste in your gpg-generated passphrase when prompted
sbt "publishSigned" 
  1. Run
sbt "sonatypeBundleRelease"
  1. Go to https://central.sonatype.com/publishing/deployments, verify that all is working as expected with your deployment and publish your component when ready.

@Ragazoor
Copy link

Ragazoor commented Apr 8, 2024

Heyo! Really happy to see that support for the new interface is moving along. Are there any info that can be shared regarding when we can expect a release candidate with this change included? Like was mentioned here #474

@Andrapyre
Copy link
Contributor

I was in contact with Taro and he needed some extra time to review this, with one or two further considerations around user flow and naming, which are still TBD. @xerial , could we still get a release commit out in the current form, with a target date for a full 4.0.0 release in a month or two? That way we can gather user feedback while still making clear that setting names, etc. are open to change.

@Andrapyre
Copy link
Contributor

Andrapyre commented Jun 27, 2024

@xerial , I am confused about this new release, as I'd thought that this was permanently blocked and I instead invested effort to create a separate plugin here - https://github.com/lumidion/sbt-sonatype-central with a maintenance and feature roadmap. This plugin is now in its first release...as of a few minutes before #474 was merged.

The next step to make this feature widely available is to integrate it into sbt-ci-release. Do you have bandwidth/interest in maintaining it in this repo? If yes, I will continue with my original plan from several months ago and add the changes to sbt-ci-release without introducing the plugin I've created. If not, I would request that this feature be reverted (it has commands that will conflict with the new plugin) and I will integrate the new plugin into sbt-ci-release instead.

@BillyAutrey
Copy link

Reading through this issue, a reader might assume that this is not fixed. As far as I can tell @xerial, this should be closed.

@xerial
Copy link
Owner

xerial commented Nov 19, 2024

@BillyAutrey Thanks for the heads-up. I haven't followed this discussion thread for a while 😅. Let's close this issue.

@Andrapyre's comment will be a bit more complicated (due to my capacity and technical difficulties like #548), so it should be discussed elsewhere.

@xerial xerial closed this as completed Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants