tomaswolf commented on issue #536:
URL: https://github.com/apache/mina-sshd/issues/536#issuecomment-2249775970
You can use JDK 21 in CI, but I would not require it as minimum for building.
Still looks more complicated that needed. I'm not at my development machine,
so I cannot verify myself that this would work, but it seems to me the
following patch would be a minimal change to build with Java 11 and test on JDK
8, 11, 17:
```
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0eb87ee..7ab3828 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -29,15 +29,14 @@
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
- java: [ '8' ]
steps:
- uses: actions/checkout@v4
- - name: Set up JDK ${{ matrix.java }}
+ - name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
- java-version: ${{ matrix.java }}
+ java-version: '11'
- uses: actions/cache@v4
with:
@@ -63,7 +62,10 @@
uses: actions/setup-java@v4
with:
distribution: temurin
- java-version: ${{ matrix.java }}
+ # Unsure whether this works if matrix.java == 11. If not, need
two different setups with a conditional
+ java-version: |
+ ${{ matrix.java }}
+ '11'
- uses: actions/cache@v4
with:
@@ -74,7 +76,7 @@
- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
- run: mvn -B --errors --activate-profiles ci --no-transfer-progress
package
+ run: mvn -B --errors --activate-profiles ci
-Dtest.jdk.vendor=temurin -Dtest.jdk.version=${{ matrix.java }}
--no-transfer-progress package
- name: Archive test results and logs
# if: success() || failure() to also get the test results on
successful runs.
diff --git a/.github/workflows/master-build.yml
b/.github/workflows/master-build.yml
index 7aa899e..1d5a991 100644
--- a/.github/workflows/master-build.yml
+++ b/.github/workflows/master-build.yml
@@ -47,7 +47,7 @@
uses: actions/setup-java@v4
with:
distribution: temurin
- java-version: '8'
+ java-version: '11'
# Create a ~/.m2/settings.xml referencing these environment
variable names
server-id: 'apache.snapshots.https'
server-username: NEXUS_USERNAME
diff --git a/pom.xml b/pom.xml
index fcbc28d..60ea820 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,9 +138,6 @@
<profiles>
<profile>
<id>release</id>
- <properties>
- <required.java.version>[1.8,1.9)</required.java.version>
- </properties>
</profile>
<profile>
@@ -149,6 +146,20 @@
<sshd.tests.timeout.factor>4.0</sshd.tests.timeout.factor>
<sshd.tests.rerun.count>4</sshd.tests.rerun.count>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <jdkToolchain>
+ <version>${test.jdk.version}</version>
+ <vendor>${test.jdk.vendor}</vendor>
+ </jdkToolchain>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
```
This should use toolchains only in CI, so building locally doesn't require
people to define toolchains manually. Adapting to build with Java 21 and
running tests on 8,11,17,21 would be simple.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]