Configures maven-compiler-plugin for jspecify (#562)

* Configures maven-compiler-plugin for jspecify

Fixes gh-561

* Adds exports/open to jvm.config

Fixes gh-561

* Moves jspecify behind profile

Activate with java25 and jspecify.enabled=true

See gh-561

* Updates ant to ignore securitymanager exceptions

See gh-561

* Adds JSpecifyMode=true

Fixes some javadoc warnings

See gh-561
This commit is contained in:
Spencer Gibb
2025-10-15 14:03:13 -04:00
committed by GitHub
parent dc2f1d97f3
commit aba6318488
2 changed files with 67 additions and 15 deletions
+11 -1
View File
@@ -1 +1,11 @@
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
+56 -14
View File
@@ -41,6 +41,8 @@
<revision>${project.version}</revision>
<asciidoctorj.version>2.5.13</asciidoctorj.version>
<jruby-complete.version>9.4.9.0</jruby-complete.version>
<error-prone.version>2.42.0</error-prone.version>
<nullaway.version>0.12.10</nullaway.version>
<!-- Sonar -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -917,36 +919,76 @@
</build>
</profile>
<profile>
<id>java8</id>
<id>java17</id>
<activation>
<jdk>[1.8,)</jdk>
<jdk>[17,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>none</doclint>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java11</id>
<id>jspecify</id>
<activation>
<jdk>[1.11,)</jdk>
<jdk>[25,)</jdk>
<property>
<name>jspecify.enabled</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8212233 -->
<source>8</source>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<release>${java.version}</release>
<compilerArgs>
<compilerArg>-parameters</compilerArg>
<!-- https://errorprone.info/docs/installation#maven -->
<compilerArg>-XDcompilePolicy=simple</compilerArg>
<compilerArg>--should-stop=ifError=FLOW</compilerArg>
<compilerArg>
-Xplugin:ErrorProne
<!-- JSpecify mode https://github.com/uber/NullAway/wiki/JSpecify-Support -->
-XepOpt:NullAway:JSpecifyMode=true
<!-- Check JSpecify annotations -->
-Xep:NullAway:ERROR
-XepOpt:NullAway:OnlyNullMarked
<!-- FIXME Remove once https://github.com/uber/NullAway/pull/1295 is released -->
-XepOpt:NullAway:CustomContractAnnotations=org.springframework.lang.Contract
-XepOpt:NullAway:SuppressionNameAliases=DataFlowIssue
<!-- https://github.com/uber/NullAway/issues/162 -->
-XepExcludedPaths:.*/src/test/java/.*
</compilerArg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${nullaway.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>