Skip to content

Commit

Permalink
Postprocessing after version 7.0.2 got successfully published on Maven
Browse files Browse the repository at this point in the history
Central
  • Loading branch information
rensink committed Dec 16, 2024
1 parent b926dbd commit 6539dba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
19 changes: 15 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<version>${revision}</version>

<properties>
<revision>0.0.0-SNAPSHOT</revision>
<revision>7.0.3-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.test.skip>false</maven.test.skip>
</properties>
Expand Down Expand Up @@ -151,17 +151,28 @@
<id>maven</id>
<build>
<plugins>
<plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>

<!--plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<!--autoReleaseAfterClose>false</autoReleaseAfterClose-->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugin-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
13 changes: 8 additions & 5 deletions release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,19 @@ If something goes wrong on github and you have to repeat the last step, you firs

The process is quite complicated; although largely automated, many things can go wrong.

## Nexus staging
## Central Maven staging

Invoke the Maven target using

`mvn clean deploy -Drevision=x.y.z`

where `x.y.z` is the version number also used for the github release; see above.
where `x.y.z` is the version number also used for the github release; see above.

This can alternatively be invoked in Ecliplse using the `GROOVE - maven deploy to Central Repository` launch configuration.

The relevant plugins are `nexus-staging-maven-plugin` for staging, which relies on `maven-gpg-plugin` for signing. Staging consists of signing, uploading and checking the Maven Central constraints. The subsections below should not be necessary once everything is up and running, but are included for completeness and understanding, and may be useful in case part of the configuration is lost.
<b>Note:</b> In a recent move from Nexus to Central Maven service, it seems as though the `-Drevision` keyword setting is no longer observed; instead, the revision should be hardcoded in `pom.xml`.

The relevant plugins are `central-publishing-maven-plugin` for staging, which relies on `maven-gpg-plugin` for signing. Staging consists of signing, uploading and checking the Maven Central constraints. The subsections below should not be necessary once everything is up and running, but are included for completeness and understanding, and may be useful in case part of the configuration is lost.


### Signing
Expand All @@ -116,9 +118,10 @@ The signing phase involves many different components, all of which have to work

### Authenticating

The uploading phase requires Maven to be able to log into `https://s01.oss.sonatype.org`, but using a User Token rather than the Used ID. This User Token is be generated by the server itself (see <https://central.sonatype.org/publish/generate-token/>) and must then be saved in the Maven `settings.xml` file, which is in the `.m2` directory in `C:\Users\<username>` --- with the understanding that the Server ID, which on that page is given as `${server}`, should be set to the name also used in the stagin plugin --- by default `ossrh`.
The uploading phase requires Maven to be able to log into `https://central.sonatype.com`, but using a User Token rather than the Used ID. This User Token is be generated by the server itself (see <https://central.sonatype.org/publish/generate-portal-token/>) and must then be saved in the Maven `settings.xml` file, which is in the `.m2` directory in `C:\Users\<username>` --- with the understanding that the Server ID, which on that page is given as `${server}`, should be set to the name also used in the stagin plugin --- by default `central`.

## Deployment

The staging is followed by a manual deployment/release step described in <https://central.sonatype.org/publish/release>. (This can be changed into an automatic step by setting the `autoReleaseAfterClose` property in the Nexus staging plugin to `true`.)
If `autoPublish` is not set in the `central-publishing-maven-plugin`, the staging must be followed by a manual deployment/release step described in <https://central.sonatype.org/publish-ea/publish-ea-guide>.


Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.3-SNAPSHOT
7.0.3

0 comments on commit 6539dba

Please sign in to comment.