You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify Central deployment & update Release Process guide (#2902)
* Simplify Central deployment & update Release Process guide
* Move central-publishing-maven-plugin outside profiles
Plugin only runs for `deploy` goal anyway so no need to have this in release profile.
Additionally, the other modules (currently only `gson`) declare it as regular plugin, not inside a profile, as well.
Copy file name to clipboardExpand all lines: ReleaseProcess.md
+29-36Lines changed: 29 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,20 @@ The following is a step-by-step procedure for releasing a new version of Google-
4
4
5
5
1. Go through all open bugs and identify which will be fixed in this release. Mark all others with an appropriate release tag. Identify duplicates, and close the bugs that will never be fixed. Fix all bugs for the release, and mark them fixed.
6
6
1. Ensure all changelists are code-reviewed and have +1
7
+
1. Make sure your `${user.home}/.m2/settings.xml` contains the [Maven Central credentials](https://central.sonatype.org/publish/publish-portal-maven/#credentials)
7
8
1.`cd gson` to the parent directory; ensure there are no open files and all changes are committed.
8
9
1. Run `mvn release:clean`
9
10
1. Start the release: `mvn release:prepare`
10
11
- Answer questions: usually the defaults are fine. Try to follow [Semantic Versioning](https://semver.org/) when choosing the release version number.
11
12
- 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.
12
13
1. Complete the release: `mvn release:perform`
13
-
1.[Log in to Nexus repository manager](https://oss.sonatype.org/index.html#welcome) at Sonatype and close the staging repository for Gson.
14
-
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.
15
-
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/).
16
-
1. Create a [GitHub release](https://github.com/google/gson/releases) for the new version. You can let GitHub [automatically generate the description for the release](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes), but you should edit it manually to point out the most important changes and potentially incompatible changes.
14
+
1.[Log in to the Central Portal](https://central.sonatype.com/)
15
+
1. Download and sanity check all files.\
16
+
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.
17
+
1. Publish the new Gson version in the Central Portal.\
18
+
Gson will now get synced to Maven Central within the next hour.
19
+
1. Create a [GitHub release](https://github.com/google/gson/releases) for the new version.\
20
+
You can let GitHub [automatically generate the description for the release](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes), but you should edit it manually to point out the most important changes and potentially incompatible changes.
17
21
1. Update version references in (version might be referenced multiple times):
18
22
-[`README.md`](README.md)
19
23
-[`UserGuide.md`](UserGuide.md)
@@ -24,62 +28,49 @@ The following is a step-by-step procedure for releasing a new version of Google-
24
28
25
29
Important: When aborting a release / rolling back release preparations, make sure to also revert all changes to files which were done during the release (e.g. automatic replacement of version references).
26
30
27
-
## Configuring a machine for deployment to Sonatype Repository
28
-
29
-
This section was borrowed heavily from [Doclava release process](https://code.google.com/archive/p/doclava/wikis/ProcessRelease.wiki).
30
-
31
-
1. Install/Configure GPG following this [guide](https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/).
1. Create `~/.m2/settings.xml` similar to as described in [Doclava release process](https://code.google.com/p/doclava/wiki/ProcessRelease).
34
-
1. Now for deploying a snapshot repository, use `mvn deploy`.
35
-
36
-
## Getting Maven Publishing Privileges
37
-
38
-
See [OSSRH Publish Guide](https://central.sonatype.org/publish/publish-guide/).
39
-
40
31
## Testing Maven release workflow locally
41
32
42
33
The following describes how to perform the steps of the release locally to verify that they work as desired.
43
34
44
-
**Warning:** Be careful with this, these steps might be outdated or incomplete. Doublecheck that you are working on a copy of your local Gson Git repository and make sure you have followed all steps. To be safe you can also temporarily turn off your internet connection to avoid accidentally pushing changes to the real remote Git or Maven repository.\
45
-
As an alternative to the steps described below you can instead [perform a dry run](https://maven.apache.org/maven-release/maven-release-plugin/usage.html#do-a-dry-run), though this might not behave identical to a real release.
35
+
> [!CAUTION]\
36
+
> Be careful with this, these steps might be outdated or incomplete. Double-check that you are working on a copy of your local Gson Git repository and make sure you have followed all steps. To be safe you can also temporarily turn off your internet connection to avoid accidentally pushing changes to the real remote Git or Maven repository.\
37
+
> As an alternative to the steps described below you can instead [perform a dry run](https://maven.apache.org/maven-release/maven-release-plugin/usage.html#do-a-dry-run), though this might not behave identical to a real release.
46
38
47
39
1. Make a copy of your local Gson Git repository and only work with that copy
48
-
2. Make sure you are on the `main` branch
49
-
3. Create a temp directory outside the Gson directory\
40
+
1. Make sure you are on the `main` branch
41
+
1. Create a temp directory outside the Gson directory\
50
42
In the following steps this will be called `#gson-remote-temp#`; replace this with the actual absolute file path of the directory, using only forward slashes. For example under Windows `C:\my-dir` becomes `C:/my-dir`.
51
-
4. Create the directory `#gson-remote-temp#/git-repo`
52
-
5. In that directory run
43
+
1. Create the directory `#gson-remote-temp#/git-repo`
44
+
1. In that directory run
53
45
54
46
```sh
55
47
git init --bare --initial-branch=main .
56
48
```
57
49
58
-
6. Create the directory `#gson-remote-temp#/maven-repo`
59
-
7. Edit the root `pom.xml` of Gson
50
+
1. Edit the root `pom.xml` of Gson
60
51
1. Change the `<developerConnection>` to
61
52
62
53
```txt
63
54
scm:git:file:///#gson-remote-temp#/git-repo
64
55
```
65
56
66
-
2. Change the `<url>` of the `<distributionManagement>` to
57
+
1. For the `central-publishing-maven-plugin`**inside the `<pluginManagement>`**, add the following to its `<configuration>`
67
58
68
-
```txt
69
-
file:///#gson-remote-temp#/maven-repo
59
+
```xml
60
+
<skipPublishing>true</skipPublishing>
70
61
```
71
62
72
-
3. If you don't want to use GPG, remove the `maven-gpg-plugin` entry from the 'release' profile.\
63
+
1. If you don't want to use GPG, remove the `maven-gpg-plugin` entry from the 'release' profile.\
73
64
There is also an entry under `<pluginManagement>`; you can remove that as well.
74
-
8. Commit the changes using Git
75
-
9. Change the remote repository of the Git project
65
+
1. Commit the changes using Git
66
+
1. Change the remote repository of the Git project
76
67
77
68
<!-- Uses `txt` instead of `sh` to avoid the `#` being highlighted in some way -->
@@ -91,16 +82,18 @@ Now you can perform the steps of the release:
91
82
mvn release:clean
92
83
```
93
84
94
-
2. ```sh
85
+
1. ```sh
95
86
mvn release:prepare
96
87
```
97
88
98
-
3. ```sh
89
+
1. ```sh
99
90
mvn release:perform
100
91
```
101
92
102
-
4. Verify that `#gson-remote-temp#/git-repo` and `#gson-remote-temp#/maven-repo` contain all the desired changes
103
-
5. Afterwards delete all Gson files under `${user.home}/.m2/repository/com/google/code/gson` which have been installed in your local Maven repository during the release.\
93
+
1. Verify that `#gson-remote-temp#/git-repo` contains the desired changes
94
+
1. Verify that in the Gson project directory where you performed the release, the `target/checkout/target/central-publishing/central-bundle.zip` file contains the desired artifacts\
95
+
Currently that is the artifacts for `gson-parent` and `gson`.
96
+
1. Afterwards delete all Gson files under `${user.home}/.m2/repository/com/google/code/gson` which have been installed in your local Maven repository during the release.\
104
97
Otherwise Maven might not download the real Gson artifacts with these version numbers, once they are released.
0 commit comments