|
6 | 6 |
|
7 | 7 | ## Maven
|
8 | 8 |
|
| 9 | +Build uses Maven Wrapper with latest Maven 3.9.9. |
| 10 | + |
9 | 11 | Note: Build uses latest `maven-gpg-plugin` and is getting rid "old bad practices" of storing sensitive information in
|
10 | 12 | any Maven configuration file. Hence, on Workstations, users are recommended to have GPG Agent set up and running,
|
11 | 13 | as plugin will make use of it to get the sensitive information. On unattended releases, the use of
|
12 | 14 | BouncyCastle signer is recommended, and use environment variables `MAVEN_GPG_KEY` and `MAVEN_GPG_PASSPHRASE`
|
13 | 15 | to pass over the key material and the passphrase to `maven-gpg-plugin`.
|
14 | 16 | See [maven-gpg-plugin site](https://maven.apache.org/plugins/maven-gpg-plugin/usage.html) for more information.
|
15 | 17 |
|
| 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 | + |
16 | 56 | ### Release steps
|
17 | 57 |
|
18 | 58 | **Prerequisites:**
|
19 | 59 | * deploy snapshot: `mvn deploy -P sisu-release` for testing
|
20 | 60 | * make sure source code does not have `@since TBD`; of have, search/replace it with upcoming version
|
21 | 61 | * perform the release
|
22 | 62 |
|
23 |
| -The "usual" Maven release: |
| 63 | +To perform Maven release invoke: |
24 | 64 | * `mvn release:prepare`
|
25 | 65 | * `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`. |
27 | 68 |
|
28 | 69 | ## Site
|
29 | 70 |
|
|
0 commit comments