From 2266ccdd670b1e914c18aa5928ddd24c93deeed4 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Wed, 7 Sep 2022 01:26:53 +0200 Subject: [PATCH] Remove usage of oss-parent Maven parent and update ReleaseProcess.md (#2159) The oss-parent configuration has been applied manually to the root pom.xml, except that now newer plugin versions are used for source and javadoc JAR creation, and for GPG signing. This required some reordering of the plugins for the gson module to make sure they are executed in the correct order. Otherwise this would cause failures for javadoc:jar. --- .github/workflows/build.yml | 4 +- ReleaseProcess.md | 24 +++-- extras/pom.xml | 1 - gson/pom.xml | 188 +++++++++++++++++++----------------- metrics/pom.xml | 1 - pom.xml | 107 ++++++++++++++------ proto/pom.xml | 1 - 7 files changed, 193 insertions(+), 133 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf07103b..a1677a18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,5 +15,5 @@ jobs: java-version: '11' cache: 'maven' - name: Build with Maven - # This also runs javadoc:javadoc to detect any issues with the Javadoc - run: mvn --batch-mode --update-snapshots verify javadoc:javadoc + # This also runs javadoc:jar to detect any issues with the Javadoc generated during release + run: mvn --batch-mode --update-snapshots verify javadoc:jar diff --git a/ReleaseProcess.md b/ReleaseProcess.md index 4b85f4dc..6e2b923d 100644 --- a/ReleaseProcess.md +++ b/ReleaseProcess.md @@ -8,17 +8,18 @@ The following is a step-by-step procedure for releasing a new version of Google- 1. Run `mvn release:clean` 1. Do a dry run: `mvn release:prepare -DdryRun=true` 1. Start the release: `mvn release:prepare` - * Answer questions: usually the defaults are fine. - * This will do a full build, change version from `-SNAPSHOT` to the released version, commit and create the tags. It will then change the version to `-SNAPSHOT` for the next release. + - Answer questions: usually the defaults are fine. Try to follow [Semantic Versioning](https://semver.org/) when choosing the release version number. + - This will do a full build, change version from `-SNAPSHOT` to the released version, commit and create the tags. It will then change the version to `-SNAPSHOT` for the next release. 1. Complete the release: `mvn release:perform` 1. [Log in to Nexus repository manager](https://oss.sonatype.org/index.html#welcome) at Sonatype and close the staging repository for Gson. -1. Download and sanity check all downloads. Do not skip this step! Once you release the staging repository, there is no going back. It will get synced with Maven central and you will not be able to update or delete anything. Your only recourse will be to release a new version of Gson and hope that no one uses the old one. -1. Release the staging repository for Gson. Gson will now get synced to Maven central with-in the next hour. For issues consult [Sonatype Guide](https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt). - -1. Update the version in the [Using Gson with Maven2 page](https://github.com/google/gson/blob/master/UserGuide.md#TOC-Gson-With-Maven) -1. Update [Gson Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md). Also, look at all bugs that were fixed and add a few lines describing what changed in the release. -1. Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson) -1. Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/GSON) and update the current "stable" release. +1. Download and sanity check all downloads. Do not skip this step! Once you release the staging repository, there is no going back. It will get synced with Maven Central and you will not be able to update or delete anything. Your only recourse will be to release a new version of Gson and hope that no one uses the old one. +1. Release the staging repository for Gson. Gson will now get synced to Maven Central with-in the next hour. For issues consult [Sonatype Guide](https://central.sonatype.org/publish/release/). +1. Update [Gson Changelog](CHANGELOG.md). Also, look at all bugs that were fixed and add a few lines describing what changed in the release. +1. Update version references in (version might be referenced multiple times): + - [`README.md`](README.md) + - [`UserGuide.md`](UserGuide.md) +1. Optional: Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson). +1. Optional: Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/Gson) and update the current "stable" release. ## Configuring a machine for deployment to Sonatype Repository @@ -31,10 +32,7 @@ This section was borrowed heavily from [Doclava release process](https://code.go ## Getting Maven Publishing Privileges -Based on [Gson group thread](https://groups.google.com/d/topic/google-gson/DHWJHVFpIBg/discussion): - -1. [Sign up for a Sonatype account](https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide) following instructions under (2) on that page -1. Ask one of the existing members of the repository to create a JIRA ticket (Step 3 of above document) to add you to the publisher list. +See [OSSRH Publish Guide](https://central.sonatype.org/publish/publish-guide/). ## Running Benchmarks or Tests on Android diff --git a/extras/pom.xml b/extras/pom.xml index 586e7b2f..7e5c87ca 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -47,7 +47,6 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 true diff --git a/gson/pom.xml b/gson/pom.xml index 20c23d62..3eddb245 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -27,93 +27,9 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - - default-compile - - - - module-info.java - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M7 - - - - --illegal-access=deny - - - - org.apache.maven.plugins - maven-javadoc-plugin - - com.google.gson.internal:com.google.gson.internal.bind - - - - - - org.moditect - moditect-maven-plugin - 1.0.0.RC2 - - - add-module-info - package - - add-module-info - - - 9 - - ${project.build.sourceDirectory}/module-info.java - - - true - - - - - - biz.aQute.bnd - bnd-maven-plugin - 6.3.1 - - - - bnd-process - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - + org.codehaus.mojo templating-maven-plugin @@ -131,6 +47,52 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + default-compile + + + + module-info.java + + + + + + + biz.aQute.bnd + bnd-maven-plugin + 6.3.1 + + + + bnd-process + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M7 + + + + --illegal-access=deny + + com.coderplus.maven.plugins copy-rename-maven-plugin @@ -163,6 +125,7 @@ 2.6.0 + obfuscate-test-class process-test-classes proguard @@ -206,6 +169,57 @@ + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + + org.moditect + moditect-maven-plugin + 1.0.0.RC2 + + + add-module-info + package + + add-module-info + + + 9 + + ${project.build.sourceDirectory}/module-info.java + + + true + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + com.google.gson.internal:com.google.gson.internal.bind + + diff --git a/metrics/pom.xml b/metrics/pom.xml index fdf112e7..40f17c8f 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -56,7 +56,6 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 true diff --git a/pom.xml b/pom.xml index 52f2d0c0..be79d03a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,12 +3,6 @@ 4.0.0 - - org.sonatype.oss - oss-parent - 9 - - com.google.code.gson gson-parent 2.9.2-SNAPSHOT @@ -49,6 +43,14 @@ + + + sonatype-nexus-staging + Nexus Release Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + @@ -104,6 +106,8 @@ the project URL (= Gson GitHub repo) which is incorrect because it is not hosting the Javadoc (3) It might fail due to https://bugs.openjdk.java.net/browse/JDK-8212233 --> false + + true @@ -111,6 +115,27 @@ maven-jar-plugin 3.2.2 + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + org.apache.maven.plugins + maven-release-plugin + 3.0.0-M6 + + true + + false + release + + com.github.siom79.japicmp @@ -144,27 +169,53 @@ - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - org.apache.maven.scm - maven-scm-api - 1.13.0 - - - org.apache.maven.scm - maven-scm-provider-gitexe - 1.13.0 - - - - true - - - + + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + + diff --git a/proto/pom.xml b/proto/pom.xml index 7faa78d5..02b1ef0d 100644 --- a/proto/pom.xml +++ b/proto/pom.xml @@ -87,7 +87,6 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 true