diff --git a/README.md b/README.md index 8f0a004..958d2ee 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ mvn test -pl aauth -am -Dtest=PythonInteropTest \ - Reference implementation: [aauth-python-library](https://github.com/christian-posta/aauth-python-library) Implementation plan and progress log: [docs/PLAN.md](docs/PLAN.md), [docs/PROGRESS.md](docs/PROGRESS.md). +Publishing to Maven Central: [RELEASING.md](RELEASING.md). ## License diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..94fad8c --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,83 @@ +# Releasing to Maven Central + +The build is already wired for Central publishing (the `release` Maven profile adds sources +and javadoc jars, GPG signing, and the Central Portal upload). Two one-time setup steps must +be done by a human; after that, releases are a short procedure. + +## One-time setup + +### 1. Central Portal account + namespace + +1. Sign in at **with your GitHub account** (`marcofanti`). +2. Signing in with GitHub automatically verifies the `io.github.marcofanti` namespace. +3. Generate a **user token** (Account → Generate User Token) and put it in + `~/.m2/settings.xml`: + + ```xml + + + + central + + + + + + ``` + + The `id` must be `central` (it matches `publishingServerId` in the parent POM). + Never commit these credentials. + +### 2. GPG signing key + +```bash +gpg --gen-key # name: Marco Fanti, email: your GitHub email +gpg --list-keys --keyid-format long # note the key ID (after ed25519/ or rsa4096/) +gpg --keyserver keyserver.ubuntu.com --send-keys +``` + +Central verifies signatures against public keyservers; sending the key once is enough. +The `maven-gpg-plugin` uses `gpg-agent`, so you'll be prompted for the passphrase on the +first signing of a session. + +## Release procedure + +```bash +# 1. Start from a green main +git checkout main && git pull && mvn verify + +# 2. Set the release version (drop -SNAPSHOT) in all three POMs +mvn versions:set -DnewVersion=0.1.0 && mvn versions:commit + +# 3. Commit and tag (via PR per repo convention, or directly if you prefer for releases) +git commit -am "release: 0.1.0" && git tag v0.1.0 + +# 4. Build, sign and upload to the Central Portal +mvn clean deploy -Prelease + +# 5. Publish: the artifacts land in https://central.sonatype.com/publishing as a +# validated deployment — press "Publish" there. (To skip the manual press, add +# true to the central-publishing-maven-plugin config.) + +# 6. Bump back to the next snapshot and push +mvn versions:set -DnewVersion=0.2.0-SNAPSHOT && mvn versions:commit +git commit -am "chore: bump to 0.2.0-SNAPSHOT" && git push && git push --tags +``` + +Artifacts appear on Maven Central (search.maven.org) within an hour of publishing: + +```xml + + io.github.marcofanti + aauth + 0.1.0 + +``` + +## Notes + +- `mvn verify -Prelease -Dgpg.skip=true` exercises the sources/javadoc jar generation + without needing the GPG key (useful as a pre-release smoke test; CI does not run the + release profile). +- Javadoc runs with `doclint` on (missing-comment checks relaxed); a javadoc error fails + the release build rather than shipping a broken javadoc jar. diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 05db5e9..3960b25 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -64,6 +64,10 @@ reference with no findings. to loopback (see `TestHosts`); CI runners fall back to `127.0.0.1`. First CI run failed on unresolvable lab hostnames; second run green. +- **Maven Central plumbing added (2026-08-02)**: `` metadata plus a `release` profile + (sources/javadoc jars, GPG signing, central-publishing-maven-plugin). Manual steps + (Portal signup, GPG key) documented in RELEASING.md. Normal builds unaffected. + ## Test fixtures Per user request (2026-07-30), test fixtures and examples use the local UMA lab hostnames diff --git a/pom.xml b/pom.xml index ec1e581..e1df648 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,13 @@ + + scm:git:https://github.com/marcofanti/aauth-java-library.git + scm:git:git@github.com:marcofanti/aauth-java-library.git + https://github.com/marcofanti/aauth-java-library + HEAD + + aauth-signing aauth @@ -42,6 +49,10 @@ 3.27.7 3.15.0 + 3.4.0 + 3.12.0 + 3.2.8 + 0.11.0 3.5.6 3.6.3 0.8.15 @@ -201,4 +212,73 @@ + + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + all,-missing + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + true + + + + + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + true + + central + + + + + +