diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 49e56173..53266c2b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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 @@ -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 diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/AbstractContainerSupportUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/AbstractContainerSupportUtil.java index fd650f25..0079cbae 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/AbstractContainerSupportUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/AbstractContainerSupportUtil.java @@ -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(); @@ -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; } @@ -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; }