Skip to content

Commit 2266ccd

Browse files
authored
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.
1 parent e1b3a03 commit 2266ccd

File tree

7 files changed

+176
-116
lines changed

7 files changed

+176
-116
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
java-version: '11'
1616
cache: 'maven'
1717
- name: Build with Maven
18-
# This also runs javadoc:javadoc to detect any issues with the Javadoc
19-
run: mvn --batch-mode --update-snapshots verify javadoc:javadoc
18+
# This also runs javadoc:jar to detect any issues with the Javadoc generated during release
19+
run: mvn --batch-mode --update-snapshots verify javadoc:jar

ReleaseProcess.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ The following is a step-by-step procedure for releasing a new version of Google-
88
1. Run `mvn release:clean`
99
1. Do a dry run: `mvn release:prepare -DdryRun=true`
1010
1. Start the release: `mvn release:prepare`
11-
* Answer questions: usually the defaults are fine.
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.
11+
- Answer questions: usually the defaults are fine. Try to follow [Semantic Versioning](https://semver.org/) when choosing the release version number.
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.
1313
1. Complete the release: `mvn release:perform`
1414
1. [Log in to Nexus repository manager](https://oss.sonatype.org/index.html#welcome) at Sonatype and close the staging repository for Gson.
15-
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.
16-
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).
17-
18-
1. Update the version in the [Using Gson with Maven2 page](https://github.com/google/gson/blob/master/UserGuide.md#TOC-Gson-With-Maven)
19-
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.
20-
1. Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson)
21-
1. Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/GSON) and update the current "stable" release.
15+
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.
16+
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/).
17+
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.
18+
1. Update version references in (version might be referenced multiple times):
19+
- [`README.md`](README.md)
20+
- [`UserGuide.md`](UserGuide.md)
21+
1. Optional: Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson).
22+
1. Optional: Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/Gson) and update the current "stable" release.
2223

2324
## Configuring a machine for deployment to Sonatype Repository
2425

@@ -31,10 +32,7 @@ This section was borrowed heavily from [Doclava release process](https://code.go
3132

3233
## Getting Maven Publishing Privileges
3334

34-
Based on [Gson group thread](https://groups.google.com/d/topic/google-gson/DHWJHVFpIBg/discussion):
35-
36-
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
37-
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.
35+
See [OSSRH Publish Guide](https://central.sonatype.org/publish/publish-guide/).
3836

3937
## Running Benchmarks or Tests on Android
4038

extras/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<plugin>
4848
<groupId>org.apache.maven.plugins</groupId>
4949
<artifactId>maven-deploy-plugin</artifactId>
50-
<version>3.0.0</version>
5150
<configuration>
5251
<!-- Currently not deployed -->
5352
<skip>true</skip>

gson/pom.xml

+84-70
Original file line numberDiff line numberDiff line change
@@ -27,67 +27,37 @@
2727

2828
<build>
2929
<plugins>
30+
<!--
31+
Plugins for source generation and compilation
32+
-->
3033
<plugin>
31-
<groupId>org.apache.maven.plugins</groupId>
32-
<artifactId>maven-compiler-plugin</artifactId>
34+
<groupId>org.codehaus.mojo</groupId>
35+
<artifactId>templating-maven-plugin</artifactId>
36+
<version>1.0.0</version>
3337
<executions>
3438
<execution>
35-
<id>default-compile</id>
39+
<id>filtering-java-templates</id>
40+
<goals>
41+
<goal>filter-sources</goal>
42+
</goals>
3643
<configuration>
37-
<excludes>
38-
<!-- module-info.java is compiled using ModiTect -->
39-
<exclude>module-info.java</exclude>
40-
</excludes>
44+
<sourceDirectory>${basedir}/src/main/java-templates</sourceDirectory>
45+
<outputDirectory>${project.build.directory}/generated-sources/java-templates</outputDirectory>
4146
</configuration>
4247
</execution>
4348
</executions>
4449
</plugin>
45-
<!-- Note: Javadoc plugin has to be run in combination with >= `package`
46-
phase, e.g. `mvn package javadoc:javadoc`, otherwise it fails with
47-
"Aggregator report contains named and unnamed modules" -->
4850
<plugin>
4951
<groupId>org.apache.maven.plugins</groupId>
50-
<artifactId>maven-surefire-plugin</artifactId>
51-
<version>3.0.0-M7</version>
52-
<configuration>
53-
<!-- Deny illegal access, this is required for ReflectionAccessTest -->
54-
<!-- Requires Java >= 9; Important: In case future Java versions
55-
don't support this flag anymore, don't remove it unless CI also runs with
56-
that Java version. Ideally would use toolchain to specify that this should
57-
run with e.g. Java 11, but Maven toolchain requirements (unlike Gradle ones)
58-
don't seem to be portable (every developer would have to set up toolchain
59-
configuration locally). -->
60-
<argLine>--illegal-access=deny</argLine>
61-
</configuration>
62-
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-javadoc-plugin</artifactId>
66-
<configuration>
67-
<excludePackageNames>com.google.gson.internal:com.google.gson.internal.bind</excludePackageNames>
68-
</configuration>
69-
</plugin>
70-
<!-- Add module-info to JAR, see https://github.com/moditect/moditect#adding-module-descriptors-to-existing-jar-files -->
71-
<!-- Uses ModiTect instead of separate maven-compiler-plugin executions
72-
for better Eclipse IDE support, see https://github.com/eclipse-m2e/m2e-core/issues/393 -->
73-
<plugin>
74-
<groupId>org.moditect</groupId>
75-
<artifactId>moditect-maven-plugin</artifactId>
76-
<version>1.0.0.RC2</version>
52+
<artifactId>maven-compiler-plugin</artifactId>
7753
<executions>
7854
<execution>
79-
<id>add-module-info</id>
80-
<phase>package</phase>
81-
<goals>
82-
<goal>add-module-info</goal>
83-
</goals>
55+
<id>default-compile</id>
8456
<configuration>
85-
<jvmVersion>9</jvmVersion>
86-
<module>
87-
<moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
88-
</module>
89-
<!-- Overwrite the previously generated JAR file, if any -->
90-
<overwriteExistingFiles>true</overwriteExistingFiles>
57+
<excludes>
58+
<!-- module-info.java is compiled using ModiTect -->
59+
<exclude>module-info.java</exclude>
60+
</excludes>
9161
</configuration>
9262
</execution>
9363
</executions>
@@ -104,33 +74,25 @@
10474
</execution>
10575
</executions>
10676
</plugin>
77+
78+
<!--
79+
Plugins for test execution
80+
-->
10781
<plugin>
10882
<groupId>org.apache.maven.plugins</groupId>
109-
<artifactId>maven-jar-plugin</artifactId>
83+
<artifactId>maven-surefire-plugin</artifactId>
84+
<version>3.0.0-M7</version>
11085
<configuration>
111-
<archive>
112-
<!-- Use existing manifest generated by BND plugin -->
113-
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
114-
</archive>
86+
<!-- Deny illegal access, this is required for ReflectionAccessTest -->
87+
<!-- Requires Java >= 9; Important: In case future Java versions
88+
don't support this flag anymore, don't remove it unless CI also runs with
89+
that Java version. Ideally would use toolchain to specify that this should
90+
run with e.g. Java 11, but Maven toolchain requirements (unlike Gradle ones)
91+
don't seem to be portable (every developer would have to set up toolchain
92+
configuration locally). -->
93+
<argLine>--illegal-access=deny</argLine>
11594
</configuration>
11695
</plugin>
117-
<plugin>
118-
<groupId>org.codehaus.mojo</groupId>
119-
<artifactId>templating-maven-plugin</artifactId>
120-
<version>1.0.0</version>
121-
<executions>
122-
<execution>
123-
<id>filtering-java-templates</id>
124-
<goals>
125-
<goal>filter-sources</goal>
126-
</goals>
127-
<configuration>
128-
<sourceDirectory>${basedir}/src/main/java-templates</sourceDirectory>
129-
<outputDirectory>${project.build.directory}/generated-sources/java-templates</outputDirectory>
130-
</configuration>
131-
</execution>
132-
</executions>
133-
</plugin>
13496
<plugin>
13597
<groupId>com.coderplus.maven.plugins</groupId>
13698
<artifactId>copy-rename-maven-plugin</artifactId>
@@ -163,6 +125,7 @@
163125
<version>2.6.0</version>
164126
<executions>
165127
<execution>
128+
<id>obfuscate-test-class</id>
166129
<phase>process-test-classes</phase>
167130
<goals>
168131
<goal>proguard</goal>
@@ -206,6 +169,57 @@
206169
</execution>
207170
</executions>
208171
</plugin>
172+
173+
<!--
174+
Plugins for building / modifying artifacts
175+
-->
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-jar-plugin</artifactId>
179+
<configuration>
180+
<archive>
181+
<!-- Use existing manifest generated by BND plugin -->
182+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
183+
</archive>
184+
</configuration>
185+
</plugin>
186+
<!-- Add module-info to JAR, see https://github.com/moditect/moditect#adding-module-descriptors-to-existing-jar-files -->
187+
<!-- Uses ModiTect instead of separate maven-compiler-plugin executions
188+
for better Eclipse IDE support, see https://github.com/eclipse-m2e/m2e-core/issues/393 -->
189+
<!-- Note: For some reason this has to be executed before javadoc plugin; otherwise `javadoc:jar` goal fails
190+
to find source files -->
191+
<plugin>
192+
<groupId>org.moditect</groupId>
193+
<artifactId>moditect-maven-plugin</artifactId>
194+
<version>1.0.0.RC2</version>
195+
<executions>
196+
<execution>
197+
<id>add-module-info</id>
198+
<phase>package</phase>
199+
<goals>
200+
<goal>add-module-info</goal>
201+
</goals>
202+
<configuration>
203+
<jvmVersion>9</jvmVersion>
204+
<module>
205+
<moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
206+
</module>
207+
<!-- Overwrite the previously generated JAR file, if any -->
208+
<overwriteExistingFiles>true</overwriteExistingFiles>
209+
</configuration>
210+
</execution>
211+
</executions>
212+
</plugin>
213+
<!-- Note: Javadoc plugin has to be run in combination with >= `package` phase,
214+
e.g. `mvn package javadoc:javadoc`, otherwise it fails with
215+
"Aggregator report contains named and unnamed modules" -->
216+
<plugin>
217+
<groupId>org.apache.maven.plugins</groupId>
218+
<artifactId>maven-javadoc-plugin</artifactId>
219+
<configuration>
220+
<excludePackageNames>com.google.gson.internal:com.google.gson.internal.bind</excludePackageNames>
221+
</configuration>
222+
</plugin>
209223
</plugins>
210224
</build>
211225
</project>

metrics/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
<plugin>
5757
<groupId>org.apache.maven.plugins</groupId>
5858
<artifactId>maven-deploy-plugin</artifactId>
59-
<version>3.0.0</version>
6059
<configuration>
6160
<!-- Not deployed -->
6261
<skip>true</skip>

0 commit comments

Comments
 (0)