Skip to content

Commit

Permalink
chore(ci): use jdk 21 as default build jdk ☕️
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Dec 18, 2023
1 parent 18628c6 commit 46fc847
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
with:
java-version: 17
distribution: microsoft
- name: Setup Java 19
uses: actions/setup-java@v4
with:
java-version: 19
distribution: temurin
- name: Setup Java 21
uses: actions/setup-java@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/fast_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Java 19
- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: 19
distribution: temurin
java-version: 21
distribution: zulu
# only first java setup need enable cache
cache: maven
- name: Build and test with Java 19
- name: Build and test with Java 21
run: ./mvnw -V --no-transfer-progress clean install

- name: Setup Java 8
Expand Down
2 changes: 1 addition & 1 deletion cffu-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
</execution>
</executions>
<configuration>
<jdkVersion>19</jdkVersion>
<jdkVersion>21</jdkVersion>
<documentedVisibilities>
<visibility>PUBLIC</visibility>
<visibility>PROTECTED</visibility>
Expand Down
21 changes: 20 additions & 1 deletion demos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven</id>
<id>enforce-require-version</id>
<goals>
<goal>enforce</goal>
</goals>
Expand Down Expand Up @@ -284,5 +284,24 @@
</plugins>
</build>
</profile>
<profile>
<id>disable-javac-options-warning-for-java21+</id>
<activation>
<jdk>[21,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
53 changes: 52 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven</id>
<id>enforce-require-version</id>
<goals>
<goal>enforce</goal>
</goals>
Expand Down Expand Up @@ -515,6 +515,57 @@
</plugins>
</build>
</profile>
<profile>
<id>disable-javac-options-warning-for-java21+</id>
<activation>
<jdk>[21,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>enforce-jdk-21-when-release</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-require-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>21</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gen-src</id>
<activation>
Expand Down
3 changes: 1 addition & 2 deletions scripts/integration_test
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ source "$BASH_BUDDY_ROOT/lib/maven_utils.sh"
# ci build logic
################################################################################

readonly default_build_jdk_version=19
readonly default_build_jdk_version=21
# shellcheck disable=SC2034
readonly JDK_VERSIONS=(
8
11
17
"$default_build_jdk_version"
21
)

# here use `install` and `-D performRelease` intended
Expand Down
2 changes: 1 addition & 1 deletion scripts/maven_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd "$(dirname "$(readlink -f "$0")")/.."

source "scripts/bash-buddy/lib/java_utils.sh"

jvu::switch_to_jdk 19
jvu::switch_to_jdk 21

########################################
# integration test
Expand Down

0 comments on commit 46fc847

Please sign in to comment.