Skip to content

Commit

Permalink
Test with Java 21 (#422)
Browse files Browse the repository at this point in the history
* Test with Java 21

* Check docker and podman versions when setIsDocker() is called

* Use Podman if Docker not found
  • Loading branch information
mattbsox authored Oct 19, 2023
1 parent 0936b05 commit dbb5ff3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
os: [ ubuntu-latest, windows-latest ]
java: [ 8, 11, 17 ]
java: [ 8, 11, 17, 21 ]

steps:
- name: Checkout ci.common
Expand All @@ -37,6 +37,6 @@ jobs:
cache: 'maven'
- name: Install ci.ant
run: |
./mvnw -V clean install -f ci.ant
./mvnw -V clean install -f ci.ant -DskipTests
- name: Build and run tests
run: ./mvnw -V clean install
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ public abstract class AbstractContainerSupportUtil {
*/
public abstract void info(String msg);

public void setIsDocker(boolean isDocker) throws PluginExecutionException {
this.isDocker = isDocker;
this.checkedContainerType = true;

if (this.isDocker) {
checkDockerVersion();
} else {
checkPodmanVersion();
}
}

protected String getContainerCommandPrefix() throws PluginExecutionException {
if (!checkedContainerType) {
checkDockerVersion();
Expand Down Expand Up @@ -79,8 +90,11 @@ protected boolean checkDockerVersion() throws PluginExecutionException {
throw new PluginExecutionException("The detected Docker client version number is not supported:" + dockerVersion.trim() + ". Docker version must be " + MIN_DOCKER_VERSION + " or higher.");
}
}
isDocker = true;
checkedContainerType = true;

if (!checkedContainerType) {
isDocker = true;
checkedContainerType = true;
}
return true;
}

Expand All @@ -96,8 +110,10 @@ private boolean checkPodmanVersion() throws PluginExecutionException {
if (VersionUtility.compareArtifactVersion(podmanVersion, MIN_PODMAN_VERSION, false) < 0) {
throw new PluginExecutionException("The detected Podman client version number is not supported:" + podmanVersion.trim() + ". Podman version must be " + MIN_PODMAN_VERSION + " or higher.");
}

isDocker = false;
checkedContainerType = true;

return true;
}

Expand Down

0 comments on commit dbb5ff3

Please sign in to comment.