Skip to content

Commit 7dbdb49

Browse files
authored
Publishing to Central (#208)
Update POM and RELEASE doco. Fixes #187
1 parent f92c669 commit 7dbdb49

File tree

2 files changed

+56
-8
lines changed

2 files changed

+56
-8
lines changed

RELEASE.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,65 @@
66

77
## Maven
88

9+
Build uses Maven Wrapper with latest Maven 3.9.9.
10+
911
Note: Build uses latest `maven-gpg-plugin` and is getting rid "old bad practices" of storing sensitive information in
1012
any Maven configuration file. Hence, on Workstations, users are recommended to have GPG Agent set up and running,
1113
as plugin will make use of it to get the sensitive information. On unattended releases, the use of
1214
BouncyCastle signer is recommended, and use environment variables `MAVEN_GPG_KEY` and `MAVEN_GPG_PASSPHRASE`
1315
to pass over the key material and the passphrase to `maven-gpg-plugin`.
1416
See [maven-gpg-plugin site](https://maven.apache.org/plugins/maven-gpg-plugin/usage.html) for more information.
1517

18+
### Prepare for release
19+
20+
Release uses [Maveniverse Njord](https://github.com/maveniverse/njord) to publish to [Maven Central](https://repo.maven.apache.org/maven2/)
21+
using the [Sonatype Central Portal](https://central.sonatype.com/) service.
22+
23+
Your user environment need some extra steps to prepare for publishing.
24+
25+
For start, you need to have an account on Sonatype Central Portal and your account needs to have access to
26+
`org.eclipse.sisu` namespace on Sonatype Central Portal.
27+
28+
Next, you need to obtain user tokens for publishing from Sonatype Central Portal. To generate them, log in and
29+
browse to https://central.sonatype.com/account page and use Generate User Token.
30+
31+
The generated user tokens need to be added to your user Maven settings (by default the `~/.m2/settings.xml` file) as
32+
following server entry:
33+
34+
```xml
35+
<server>
36+
<id>sonatype-central-portal</id>
37+
<username>$TOKEN1</username>
38+
<password>$TOKEN2</password>
39+
<configuration>
40+
<njord.publisher>sonatype-cp</njord.publisher>
41+
<njord.releaseUrl>njord:template:release-sca</njord.releaseUrl>
42+
</configuration>
43+
</server>
44+
```
45+
46+
while there, another good change for settings is this:
47+
48+
```xml
49+
<pluginGroups>
50+
<pluginGroup>eu.maveniverse.maven.plugins</pluginGroup>
51+
</pluginGroups>
52+
```
53+
54+
Use command `mvn njord:status` to review publishing configuration.
55+
1656
### Release steps
1757

1858
**Prerequisites:**
1959
* deploy snapshot: `mvn deploy -P sisu-release` for testing
2060
* make sure source code does not have `@since TBD`; of have, search/replace it with upcoming version
2161
* perform the release
2262

23-
The "usual" Maven release:
63+
To perform Maven release invoke:
2464
* `mvn release:prepare`
2565
* `mvn release:perform`
26-
* project uses <https://oss.sonatype.org/> to stage (manual step: close and release staging repository)
66+
* project will be staged to [Sonatype Central Portal](https://central.sonatype.com/publishing) (manual step: once validation passes, publish it)
67+
* **don't forget to push git changes** once all done (`maven-release-plugin` is configured to not push them): `git push origin main --tags`.
2768

2869
## Site
2970

pom.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@
9696

9797
<distributionManagement>
9898
<snapshotRepository>
99-
<id>sonatype-nexus-snapshots</id>
100-
<name>Sonatype Nexus Snapshots</name>
101-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
99+
<id>sonatype-central-portal</id>
100+
<name>Sonatype Central Portal</name>
101+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
102102
</snapshotRepository>
103103
<repository>
104-
<id>sonatype-nexus-staging</id>
105-
<name>Nexus Release Repository</name>
106-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
104+
<id>sonatype-central-portal</id>
105+
<name>Sonatype Central Portal</name>
106+
<url>https://repo.maven.apache.org/maven2/</url>
107107
</repository>
108108
<site>
109109
<id>sisu.site-deploy</id>
@@ -296,6 +296,13 @@
296296
</dependencyManagement>
297297

298298
<build>
299+
<extensions>
300+
<extension>
301+
<groupId>eu.maveniverse.maven.njord</groupId>
302+
<artifactId>extension</artifactId>
303+
<version>0.5.3</version>
304+
</extension>
305+
</extensions>
299306
<pluginManagement>
300307
<plugins>
301308
<plugin>

0 commit comments

Comments
 (0)