Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions error-prone-contrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@
<artifactId>rewrite-java-21</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-25</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-templating</artifactId>
Expand Down
69 changes: 51 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-recipe-bom</artifactId>
<version>3.14.0</version>
<version>3.16.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -965,10 +965,6 @@
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
</path>
<path>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-templating</artifactId>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
Expand All @@ -992,27 +988,64 @@
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
<executions>
<!-- OpenRewrite recipe sources, generated by the
`rewrite-templating` annotation processor and
identified as classes whose name ends in `Recipes`, are
compiled to target Java 8 for compatibility with the
wider OpenRewrite ecosystem. The `maven-jar-plugin` is
configured to package these files into a separate JAR. -->
<execution>
<!-- Generates OpenRewrite recipe sources. -->
<!-- XXX: This step recompiles Refaster rule files
(identified as classes whose name ends in `Rules`)
without linting, as a workaround for a JDK 25
issue that causes `@SuppressWarnings` annotations
to be ineffectual. Merge this step back into the
default compilation step once the bug is resolved
or building with JDK 25 is no longer supported. See
https://github.com/openrewrite/rewrite-templating/issues/165. -->
<id>generate-recipes</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<annotationProcessorPaths combine.self="override">
<path>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-templating</artifactId>
</path>
</annotationProcessorPaths>
<compilerArgs combine.self="override">
<!-- This step only recompiles code, so
static analysis is irrelevant. As such we
clear all compiler arguments, specify only
those strictly required, and disable all
linting. -->
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-Xlint:none</arg>
</compilerArgs>
<includes>
<include>**/*Rules.java</include>
</includes>
<!-- Force recompilation by relying on the
MCOMPILER-209 bug mentioned above. -->
<useIncrementalCompilation>true</useIncrementalCompilation>
</configuration>
</execution>
<execution>
<!-- OpenRewrite recipe sources, generated by the
`rewrite-templating` annotation processor and
identified as classes whose name ends in `Recipes`,
are compiled to target Java 8 for compatibility
with the wider OpenRewrite ecosystem. The
`maven-jar-plugin` is configured to package these
files into a separate JAR. -->
<id>compile-recipes</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compilerArgs combine.self="override">
<!-- When Java 8 is targeted we can't use
the `add-exports` flag. And since this goal
only recompiles already-compiled code,
<!-- This step only recompiles code, so
static analysis is irrelevant. As such we
clear all compiler arguments, and only
suppress source/target/bootstrap classpath
warnings. -->
<arg>-Xlint:-options</arg>
clear all compiler arguments, specify only
those strictly required, and disable all
linting. -->
<arg>-Xlint:none</arg>
</compilerArgs>
<source>8</source>
<target>8</target>
Expand Down