Skip to content

Commit a2a618d

Browse files
committed
refactor(config): consolidate errorprone properties and profiles into sdk-platform-java-config
Consolidates all Error Prone configuration properties (version, args) and JDK-specific profiles (errorprone-jdk11, errorprone-jdk17, errorprone-jdk21) from google-cloud-pom-parent/pom.xml into sdk-platform-java-config/pom.xml. This completely cleans up google-cloud-pom-parent/pom.xml (reverting it to its original state on main), while centralizing all Error Prone configurations into the parent POM of the sdk-platform-java directory, ensuring clean inheritance for all downstream modules. BUG=b/481669998 TAG=agy CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
1 parent f0af0a2 commit a2a618d

2 files changed

Lines changed: 46 additions & 43 deletions

File tree

  • google-cloud-pom-parent
  • sdk-platform-java/sdk-platform-java-config

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>

sdk-platform-java/sdk-platform-java-config/pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,51 @@
2121
<google-cloud-shared-dependencies.version>3.63.0</google-cloud-shared-dependencies.version> <!-- {x-version-update:google-cloud-shared-dependencies:current} -->
2222
<!-- skipping clirr check for protobuf 4.x upgrade for downstream libraries -->
2323
<clirr.skip>true</clirr.skip>
24+
<errorprone.version>2.48.0</errorprone.version>
25+
<!-- By default, no special internal javac flag is needed on JDK 22+.
26+
For JDK 21 specifically, profile errorprone-jdk21 activates the required flag. -->
27+
<errorprone.javac.args>-g</errorprone.javac.args>
2428
</properties>
29+
30+
<profiles>
31+
<profile>
32+
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
33+
Because our SDK client libraries actively support building and running on Java 8+,
34+
we must downgrade to legacy Error Prone 2.38.0 when compiling under JDK < 17. -->
35+
<id>errorprone-jdk11</id>
36+
<activation>
37+
<jdk>[1.8,17)</jdk>
38+
</activation>
39+
<properties>
40+
<errorprone.version>2.38.0</errorprone.version>
41+
</properties>
42+
</profile>
43+
<profile>
44+
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
45+
When compiling under JDK 17, we downgrade to Error Prone 2.42.0 (the final release supporting JDK 17). -->
46+
<id>errorprone-jdk17</id>
47+
<activation>
48+
<jdk>[17,21)</jdk>
49+
</activation>
50+
<properties>
51+
<errorprone.version>2.42.0</errorprone.version>
52+
</properties>
53+
</profile>
54+
<profile>
55+
<!-- On JDK 21 specifically (21.0.8+), we require '-XDaddTypeAnnotationsToSymbol=true'
56+
to force Javac to eagerly attach JSR-308 type-use annotations to AST compiler symbols across
57+
compilation boundaries, avoiding internal NullPointerExceptions in Error Prone plugin evaluations.
58+
Ref: https://github.com/google/error-prone/issues/5426
59+
60+
On JDK 22+ (including 25 and 26), OpenJDK enables this cross-boundary symbol attribution fix
61+
natively by default in standard javac executions. Therefore, the flag is omitted. -->
62+
<id>errorprone-jdk21</id>
63+
<activation>
64+
<jdk>21</jdk>
65+
</activation>
66+
<properties>
67+
<errorprone.javac.args>-XDaddTypeAnnotationsToSymbol=true</errorprone.javac.args>
68+
</properties>
69+
</profile>
70+
</profiles>
2571
</project>

0 commit comments

Comments
 (0)