Skip to content

Commit 84ada86

Browse files
committed
Ignore toolchains plugin when running openrewrite
Signed-off-by: Marvin Froeder <[email protected]>
1 parent 037a6db commit 84ada86

File tree

2 files changed

+102
-57
lines changed

2 files changed

+102
-57
lines changed

.github/workflows/receive-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Execute recipes
4444
- name: Apply OpenRewrite recipes
45-
run: mvn --activate-profiles openrewrite org.openrewrite.maven:rewrite-maven-plugin:run
45+
run: ./mvnw -Dtoolchain.skip=true -Dlicense.skip=true -DskipTests=true -P openrewrite clean install
4646

4747
# Capture the diff
4848
- name: Create patch

pom.xml

Lines changed: 101 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,6 @@
479479
<redirectTestOutputToFile>true</redirectTestOutputToFile>
480480
<trimStackTrace>false</trimStackTrace>
481481
<argLine>${jvm.options}</argLine>
482-
<jdkToolchain>
483-
<version>${latest.java.version}</version>
484-
</jdkToolchain>
485482
</configuration>
486483
</plugin>
487484

@@ -492,49 +489,12 @@
492489
<configuration>
493490
<redirectTestOutputToFile>true</redirectTestOutputToFile>
494491
<trimStackTrace>false</trimStackTrace>
495-
<jdkToolchain>
496-
<version>${latest.java.version}</version>
497-
</jdkToolchain>
498492
</configuration>
499493
</plugin>
500494
</plugins>
501495
</pluginManagement>
502496

503497
<plugins>
504-
<plugin>
505-
<groupId>org.apache.maven.plugins</groupId>
506-
<artifactId>maven-toolchains-plugin</artifactId>
507-
<version>3.2.0</version>
508-
<executions>
509-
<execution>
510-
<goals>
511-
<goal>toolchain</goal>
512-
</goals>
513-
<configuration>
514-
<toolchains>
515-
<jdk>
516-
<version>${main.java.version}</version>
517-
</jdk>
518-
</toolchains>
519-
</configuration>
520-
</execution>
521-
<execution>
522-
<id>test</id>
523-
<phase>generate-test-sources</phase>
524-
<goals>
525-
<goal>toolchain</goal>
526-
</goals>
527-
<configuration>
528-
<toolchains>
529-
<jdk>
530-
<version>${latest.java.version}</version>
531-
</jdk>
532-
</toolchains>
533-
</configuration>
534-
</execution>
535-
</executions>
536-
</plugin>
537-
538498
<plugin>
539499
<groupId>org.moditect</groupId>
540500
<artifactId>moditect-maven-plugin</artifactId>
@@ -667,6 +627,9 @@
667627
<exclude>etc/header.txt</exclude>
668628
<exclude>**/.idea/**</exclude>
669629
<exclude>**/target/**</exclude>
630+
<exclude>**/scripts/**</exclude>
631+
<exclude>**/src/config/**</exclude>
632+
<exclude>**/codequality/**</exclude>
670633
<exclude>LICENSE</exclude>
671634
<exclude>NOTICE</exclude>
672635
<exclude>OSSMETADATA</exclude>
@@ -961,43 +924,125 @@
961924
<plugin>
962925
<groupId>org.openrewrite.maven</groupId>
963926
<artifactId>rewrite-maven-plugin</artifactId>
964-
<version>5.35.0</version>
965-
966-
<configuration>
967-
<activeRecipes>
968-
<recipe>org.openrewrite.java.testing.hamcrest.MigrateHamcrestToAssertJ</recipe>
969-
<recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe>
970-
<recipe>org.openrewrite.java.testing.assertj.Assertj</recipe>
971-
<recipe>org.openrewrite.java.migrate.UpgradeToJava21</recipe>
972-
</activeRecipes>
973-
<exclusions>
974-
<exclusion>**/src/main/java/**</exclusion>
975-
<exclusion>**/pom.xml</exclusion>
976-
</exclusions>
977-
</configuration>
927+
<version>5.36.0</version>
978928

979929
<dependencies>
980930
<dependency>
981931
<groupId>org.openrewrite.recipe</groupId>
982932
<artifactId>rewrite-testing-frameworks</artifactId>
983-
<version>2.13.0</version>
933+
<version>2.14.0</version>
984934
</dependency>
985935
<dependency>
986936
<groupId>org.openrewrite.recipe</groupId>
987937
<artifactId>rewrite-migrate-java</artifactId>
988-
<version>2.19.0</version>
938+
<version>2.20.0</version>
989939
</dependency>
990940
</dependencies>
991941

992942
<executions>
993943
<execution>
944+
<id>tests</id>
994945
<goals>
995946
<goal>runNoFork</goal>
996947
</goals>
997948
<phase>verify</phase>
949+
<configuration>
950+
<exportDatatables>true</exportDatatables>
951+
<activeRecipes>
952+
<recipe>org.openrewrite.java.testing.hamcrest.MigrateHamcrestToAssertJ</recipe>
953+
<recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe>
954+
<recipe>org.openrewrite.java.testing.assertj.Assertj</recipe>
955+
<recipe>org.openrewrite.java.migrate.UpgradeToJava21</recipe>
956+
</activeRecipes>
957+
<exclusions>
958+
<exclusion>**/src/main/java/**</exclusion>
959+
<exclusion>pom.xml</exclusion>
960+
</exclusions>
961+
</configuration>
962+
</execution>
963+
<execution>
964+
<id>sources</id>
965+
<goals>
966+
<goal>runNoFork</goal>
967+
</goals>
968+
<phase>verify</phase>
969+
<configuration>
970+
<exportDatatables>true</exportDatatables>
971+
<activeRecipes>
972+
<recipe>org.openrewrite.java.migrate.Java8toJava11</recipe>
973+
</activeRecipes>
974+
<exclusions>
975+
<exclusion>pom.xml</exclusion>
976+
</exclusions>
977+
</configuration>
978+
</execution>
979+
</executions>
980+
</plugin>
981+
</plugins>
982+
</build>
983+
</profile>
984+
985+
<profile>
986+
<id>toolchain</id>
987+
<activation>
988+
<property>
989+
<name>!toolchain.skip</name>
990+
</property>
991+
</activation>
992+
993+
<build>
994+
<plugins>
995+
<plugin>
996+
<groupId>org.apache.maven.plugins</groupId>
997+
<artifactId>maven-toolchains-plugin</artifactId>
998+
<version>3.2.0</version>
999+
<executions>
1000+
<execution>
1001+
<goals>
1002+
<goal>toolchain</goal>
1003+
</goals>
1004+
<configuration>
1005+
<toolchains>
1006+
<jdk>
1007+
<version>${main.java.version}</version>
1008+
</jdk>
1009+
</toolchains>
1010+
</configuration>
1011+
</execution>
1012+
<execution>
1013+
<id>test</id>
1014+
<goals>
1015+
<goal>toolchain</goal>
1016+
</goals>
1017+
<phase>generate-test-sources</phase>
1018+
<configuration>
1019+
<toolchains>
1020+
<jdk>
1021+
<version>${latest.java.version}</version>
1022+
</jdk>
1023+
</toolchains>
1024+
</configuration>
9981025
</execution>
9991026
</executions>
10001027
</plugin>
1028+
<plugin>
1029+
<groupId>org.apache.maven.plugins</groupId>
1030+
<artifactId>maven-surefire-plugin</artifactId>
1031+
<configuration>
1032+
<jdkToolchain>
1033+
<version>${latest.java.version}</version>
1034+
</jdkToolchain>
1035+
</configuration>
1036+
</plugin>
1037+
<plugin>
1038+
<groupId>org.apache.maven.plugins</groupId>
1039+
<artifactId>maven-failsafe-plugin</artifactId>
1040+
<configuration>
1041+
<jdkToolchain>
1042+
<version>${latest.java.version}</version>
1043+
</jdkToolchain>
1044+
</configuration>
1045+
</plugin>
10011046
</plugins>
10021047
</build>
10031048
</profile>

0 commit comments

Comments
 (0)