Skip to content

Commit 7ed3215

Browse files
authored
fake (#2479)
* fake * Ignore toolchains plugin when running openrewrite Signed-off-by: Marvin Froeder <[email protected]> --------- Signed-off-by: Marvin Froeder <[email protected]>
1 parent b19ff0a commit 7ed3215

File tree

3 files changed

+110
-58
lines changed

3 files changed

+110
-58
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

core/src/test/java/feign/UtilTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -20,6 +20,7 @@
2020
import static org.assertj.core.api.Assertions.assertThat;
2121
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2222
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
23+
import static org.junit.jupiter.api.Assertions.assertEquals;
2324

2425
import feign.codec.Decoder;
2526
import java.io.Reader;
@@ -85,6 +86,15 @@ void resolveLastTypeParameterWhenNotSubtype() throws Exception {
8586
assertThat(last).isEqualTo(listStringType);
8687
}
8788

89+
@Test
90+
void fake() throws Exception {
91+
Type context =
92+
LastTypeParameter.class.getDeclaredField("PARAMETERIZED_LIST_STRING").getGenericType();
93+
Type listStringType = LastTypeParameter.class.getDeclaredField("LIST_STRING").getGenericType();
94+
Type last = resolveLastTypeParameter(context, Parameterized.class);
95+
assertEquals(last, listStringType);
96+
}
97+
8898
@Test
8999
void lastTypeFromInstance() throws Exception {
90100
Parameterized<?> instance = new ParameterizedSubtype();

pom.xml

Lines changed: 98 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,122 @@
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.UpgradeToJava8</recipe>
973+
</activeRecipes>
974+
</configuration>
975+
</execution>
976+
</executions>
977+
</plugin>
978+
</plugins>
979+
</build>
980+
</profile>
981+
982+
<profile>
983+
<id>toolchain</id>
984+
<activation>
985+
<property>
986+
<name>!toolchain.skip</name>
987+
</property>
988+
</activation>
989+
990+
<build>
991+
<plugins>
992+
<plugin>
993+
<groupId>org.apache.maven.plugins</groupId>
994+
<artifactId>maven-toolchains-plugin</artifactId>
995+
<version>3.2.0</version>
996+
<executions>
997+
<execution>
998+
<goals>
999+
<goal>toolchain</goal>
1000+
</goals>
1001+
<configuration>
1002+
<toolchains>
1003+
<jdk>
1004+
<version>${main.java.version}</version>
1005+
</jdk>
1006+
</toolchains>
1007+
</configuration>
1008+
</execution>
1009+
<execution>
1010+
<id>test</id>
1011+
<goals>
1012+
<goal>toolchain</goal>
1013+
</goals>
1014+
<phase>generate-test-sources</phase>
1015+
<configuration>
1016+
<toolchains>
1017+
<jdk>
1018+
<version>${latest.java.version}</version>
1019+
</jdk>
1020+
</toolchains>
1021+
</configuration>
9981022
</execution>
9991023
</executions>
10001024
</plugin>
1025+
<plugin>
1026+
<groupId>org.apache.maven.plugins</groupId>
1027+
<artifactId>maven-surefire-plugin</artifactId>
1028+
<configuration>
1029+
<jdkToolchain>
1030+
<version>${latest.java.version}</version>
1031+
</jdkToolchain>
1032+
</configuration>
1033+
</plugin>
1034+
<plugin>
1035+
<groupId>org.apache.maven.plugins</groupId>
1036+
<artifactId>maven-failsafe-plugin</artifactId>
1037+
<configuration>
1038+
<jdkToolchain>
1039+
<version>${latest.java.version}</version>
1040+
</jdkToolchain>
1041+
</configuration>
1042+
</plugin>
10011043
</plugins>
10021044
</build>
10031045
</profile>

0 commit comments

Comments
 (0)