Skip to content

Commit 225d8eb

Browse files
committed
refactor: manage errorprone versions locally in Bigtable and Datastore
Revert the changes that extracted errorprone version management to the parent POM (google-cloud-pom-parent/pom.xml). Instead, configure BigTable and Datastore to manage their own errorprone versions and javac arguments locally in their respective parent POMs, using the 'errorprone' naming scheme consistent with shared-deps. Added errorprone-jdk8 profile to support older JDK versions (1.8 to 17) with legacy errorprone version 2.38.0. BUG=b/481669998 TAG=agy CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
1 parent f0af0a2 commit 225d8eb

3 files changed

Lines changed: 58 additions & 44 deletions

File tree

‎google-cloud-pom-parent/pom.xml‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<properties>
2323
<skipUnitTests>false</skipUnitTests>
2424
<checkstyle.header.file>java.header</checkstyle.header.file>
25-
<errorprone.version>2.48.0</errorprone.version>
26-
<!-- By default, no special internal javac flag is needed on JDK 22+.
27-
For JDK 21 specifically, profile errorprone-jdk21 activates the required flag. -->
28-
<errorprone.javac.args>-g</errorprone.javac.args>
2925
</properties>
3026

3127
<developers>
@@ -133,45 +129,6 @@
133129
</plugins>
134130
</build>
135131
</profile>
136-
<profile>
137-
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
138-
Because our SDK client libraries actively support building and running on Java 8+,
139-
we must downgrade to legacy Error Prone 2.38.0 when compiling under JDK < 17. -->
140-
<id>errorprone-jdk11</id>
141-
<activation>
142-
<jdk>[1.8,17)</jdk>
143-
</activation>
144-
<properties>
145-
<errorprone.version>2.38.0</errorprone.version>
146-
</properties>
147-
</profile>
148-
<profile>
149-
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
150-
When compiling under JDK 17, we downgrade to Error Prone 2.42.0 (the final release supporting JDK 17). -->
151-
<id>errorprone-jdk17</id>
152-
<activation>
153-
<jdk>[17,21)</jdk>
154-
</activation>
155-
<properties>
156-
<errorprone.version>2.42.0</errorprone.version>
157-
</properties>
158-
</profile>
159-
<profile>
160-
<!-- On JDK 21 specifically (21.0.8+), we require '-XDaddTypeAnnotationsToSymbol=true'
161-
to force Javac to eagerly attach JSR-308 type-use annotations to AST compiler symbols across
162-
compilation boundaries, avoiding internal NullPointerExceptions in Error Prone plugin evaluations.
163-
Ref: https://github.com/google/error-prone/issues/5426
164-
165-
On JDK 22+ (including 25 and 26), OpenJDK enables this cross-boundary symbol attribution fix
166-
natively by default in standard javac executions. Therefore, the flag is omitted. -->
167-
<id>errorprone-jdk21</id>
168-
<activation>
169-
<jdk>21</jdk>
170-
</activation>
171-
<properties>
172-
<errorprone.javac.args>-XDaddTypeAnnotationsToSymbol=true</errorprone.javac.args>
173-
</properties>
174-
</profile>
175132
</profiles>
176133

177134
<repositories>

‎java-bigtable/pom.xml‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@
144144
<github.global.server>github</github.global.server>
145145
<site.installationModule>google-cloud-bigtable-parent</site.installationModule>
146146
<project.javadoc.protobufBaseURL>https://googleapis.dev/java/google-api-grpc/latest</project.javadoc.protobufBaseURL>
147-
147+
<errorprone.version>2.48.0</errorprone.version>
148+
<errorprone.javac.args>-g</errorprone.javac.args>
148149
</properties>
149150

150151
<dependencyManagement>
@@ -345,6 +346,33 @@
345346
<skipTests>true</skipTests>
346347
</properties>
347348
</profile>
349+
<profile>
350+
<id>errorprone-jdk8</id>
351+
<activation>
352+
<jdk>[1.8,17)</jdk>
353+
</activation>
354+
<properties>
355+
<errorprone.version>2.38.0</errorprone.version>
356+
</properties>
357+
</profile>
358+
<profile>
359+
<id>errorprone-jdk17</id>
360+
<activation>
361+
<jdk>[17,21)</jdk>
362+
</activation>
363+
<properties>
364+
<errorprone.version>2.42.0</errorprone.version>
365+
</properties>
366+
</profile>
367+
<profile>
368+
<id>errorprone-jdk21</id>
369+
<activation>
370+
<jdk>21</jdk>
371+
</activation>
372+
<properties>
373+
<errorprone.javac.args>-XDaddTypeAnnotationsToSymbol=true</errorprone.javac.args>
374+
</properties>
375+
</profile>
348376
</profiles>
349377

350378
<modules>

‎java-datastore/pom.xml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@
144144
<github.global.server>github</github.global.server>
145145
<site.installationModule>google-cloud-datastore-parent</site.installationModule>
146146
<project.javadoc.protobufBaseURL>https://googleapis.dev/java/google-api-grpc/latest</project.javadoc.protobufBaseURL>
147+
<errorprone.version>2.48.0</errorprone.version>
148+
<errorprone.javac.args>-g</errorprone.javac.args>
147149
</properties>
148150

149151
<dependencyManagement>
@@ -236,5 +238,32 @@
236238
<skipTests>true</skipTests>
237239
</properties>
238240
</profile>
241+
<profile>
242+
<id>errorprone-jdk8</id>
243+
<activation>
244+
<jdk>[1.8,17)</jdk>
245+
</activation>
246+
<properties>
247+
<errorprone.version>2.38.0</errorprone.version>
248+
</properties>
249+
</profile>
250+
<profile>
251+
<id>errorprone-jdk17</id>
252+
<activation>
253+
<jdk>[17,21)</jdk>
254+
</activation>
255+
<properties>
256+
<errorprone.version>2.42.0</errorprone.version>
257+
</properties>
258+
</profile>
259+
<profile>
260+
<id>errorprone-jdk21</id>
261+
<activation>
262+
<jdk>21</jdk>
263+
</activation>
264+
<properties>
265+
<errorprone.javac.args>-XDaddTypeAnnotationsToSymbol=true</errorprone.javac.args>
266+
</properties>
267+
</profile>
239268
</profiles>
240269
</project>

0 commit comments

Comments
 (0)