diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1354838b77..2e78cd68954 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + java: [17, 21] + max-parallel: 6 runs-on: ${{ matrix.os }} continue-on-error: true @@ -16,11 +18,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '17' - distribution: temurin + java-version: ${{ matrix.java }} + distribution: 'temurin' cache: gradle - uses: gradle/wrapper-validation-action@v1 - name: Download Eclipse on Ubuntu diff --git a/CHANGELOG.md b/CHANGELOG.md index a111b022426..7622f5af9fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ Currently the versioning policy of this project follows [Semantic Versioning v2. ### Added - New detector finding `System.getenv()` calls, where the corresponding Java property could be used (See [ENV02-J](https://wiki.sei.cmu.edu/confluence/display/java/ENV02-J.+Do+not+trust+the+values+of+environment+variables)). +### Build +- Run build using jdk 17 and 21 without usage of toolchains so we do not defeat the purpose of building on both. ([#2722](https://github.com/spotbugs/spotbugs/pull/2722)) + ## 4.8.1 - 2023-11-06 ### Fixed diff --git a/build.gradle b/build.gradle index 8973ac5bf21..59c37a1673f 100644 --- a/build.gradle +++ b/build.gradle @@ -23,12 +23,6 @@ subprojects { group = 'com.github.spotbugs' version = rootProject.version - - java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } - } } allprojects { diff --git a/spotbugsTestCases/build.gradle b/spotbugsTestCases/build.gradle index 37343249ac4..6c38f97c568 100644 --- a/spotbugsTestCases/build.gradle +++ b/spotbugsTestCases/build.gradle @@ -39,9 +39,6 @@ dependencies { } tasks.withType(JavaCompile).configureEach { - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(17) - } options.compilerArgs << '-Xlint:none' options.encoding = 'UTF-8' if (it.name == 'classesJava17') {