Skip to content

Commit

Permalink
Ignore toolchains plugin when running openrewrite
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
  • Loading branch information
velo committed Jul 25, 2024
1 parent 037a6db commit deb1afb
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

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

# Capture the diff
- name: Create patch
Expand Down
112 changes: 70 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,6 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<argLine>${jvm.options}</argLine>
<jdkToolchain>
<version>${latest.java.version}</version>
</jdkToolchain>
</configuration>
</plugin>

Expand All @@ -492,49 +489,12 @@
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<jdkToolchain>
<version>${latest.java.version}</version>
</jdkToolchain>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
<configuration>
<toolchains>
<jdk>
<version>${main.java.version}</version>
</jdk>
</toolchains>
</configuration>
</execution>
<execution>
<id>test</id>
<phase>generate-test-sources</phase>
<goals>
<goal>toolchain</goal>
</goals>
<configuration>
<toolchains>
<jdk>
<version>${latest.java.version}</version>
</jdk>
</toolchains>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
Expand Down Expand Up @@ -667,6 +627,9 @@
<exclude>etc/header.txt</exclude>
<exclude>**/.idea/**</exclude>
<exclude>**/target/**</exclude>
<exclude>**/scripts/**</exclude>
<exclude>**/src/config/**</exclude>
<exclude>**/codequality/**</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>OSSMETADATA</exclude>
Expand Down Expand Up @@ -972,7 +935,7 @@
</activeRecipes>
<exclusions>
<exclusion>**/src/main/java/**</exclusion>
<exclusion>**/pom.xml</exclusion>
<exclusion>pom.xml</exclusion>
</exclusions>
</configuration>

Expand Down Expand Up @@ -1001,7 +964,72 @@
</plugins>
</build>
</profile>
</profiles>

<profile>
<id>toolchain</id>
<activation>
<property>
<name>!toolchain.skip</name>
</property>
</activation>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
<configuration>
<toolchains>
<jdk>
<version>${main.java.version}</version>
</jdk>
</toolchains>
</configuration>
</execution>
<execution>
<id>test</id>
<goals>
<goal>toolchain</goal>
</goals>
<phase>generate-test-sources</phase>
<configuration>
<toolchains>
<jdk>
<version>${latest.java.version}</version>
</jdk>
</toolchains>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${latest.java.version}</version>
</jdkToolchain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${latest.java.version}</version>
</jdkToolchain>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<contributors>
<contributor>
Expand Down

0 comments on commit deb1afb

Please sign in to comment.