You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sonatype central (which syncs to maven central) imposes additional constraints on the published artifacts, so the setup becomes a little more involved. These steps assume you're using github actions, but it'd be similar on other build servers.
55
55
56
-
### Sonatype account
57
-
If you don't have a Sonatype account yet, follow the instructions in https://central.sonatype.org/pages/ossrh-guide.html to create one.
56
+
### Sonatype central account
57
+
If you don't have a Sonatype account yet, follow the instructions in https://central.sonatype.org/register/central-portal/ to create one.
58
58
59
59
### build.sbt
60
60
In your `build.sbt` do *not* define the `version` setting and ensure the following settings *are* configured:
So that Github Actions can release on your behalf, we need to share some secrets via environment variables with github actions. You can either do that for your project or an entire organization.
128
+
So that Github Actions can release on your behalf, we need to share some secrets via environment variables with github actions. You can either do that for your project or an entire organization. Sonatype requires you to authorize your deployment artifacts with an access token, which you can get retrieve from sonatype and share with github actions as follows:
129
129
130
-
> [!NOTE]
131
-
> As of June 2024, Sonatype requires you to log in with an access token, you can no longer use your regular username/password.
132
-
133
-
First you need to obtain a Sonatype username/password token:
134
-
- log into https://oss.sonatype.org
135
-
- select `Profile` from the dropdown at the top right
136
-
-`User Token` -> `Access` -> `Access user token`
137
-
138
-
Now go to your github project or organization and navigate to `Settings` -> `Secrets and variables` -> `Actions` and add the following `Repository secrets`:
130
+
- sign into https://central.sonatype.com
131
+
- go to https://central.sonatype.com/account (or click on `Av` at the top right and navigate to `Account`)
132
+
- Generate a user token and save it somewhere
133
+
134
+
Now you can share those for your entire github organization's github actions or only for a single project as follows:
135
+
- navigate to your project or organization on github
136
+
-`Settings` -> `Secrets and variables` -> `Actions` and add the following `Repository secrets`:
139
137
-`SONATYPE_USERNAME`: the name part of the user token you generated in the previous step
140
138
-`SONATYPE_PASSWORD`: the password part of the user token you generated in the previous step
141
139
-`PGP_SECRET`: The base64 encoded secret of your private key that you can export from the command line like here below
### My Sonatype staging repos seems to be in a broken state
236
-
When a build is e.g. interrupted, or didn't satisfy the Sonatype requirements for publishing, it is likely that these artifacts are still lying around in the Sonatype staging area. You can log into https://oss.sonatype.org/ and clean it up, or just do it from within sbt, locally on your machine:
234
+
When a build is e.g. interrupted, or didn't satisfy the Sonatype requirements for publishing, it is likely that these artifacts are still lying around in the Sonatype staging area. You can log into https://central.sonatype.com/ and clean it up, or just do it from within sbt, locally on your machine:
0 commit comments