From 707a389b0f26d6df23e397ce25e54f2e2c626770 Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Thu, 9 Jan 2025 14:42:22 -0800 Subject: [PATCH] Default to using the latest version of WildFly for Java 17+. For earlier versions of Java, use WildFly 34.0.1.Final. Signed-off-by: James R. Perkins --- .github/workflows/wildfly-build.yml | 2 +- pom.xml | 18 +++- .../plugin/bootable/PackageBootableTest.java | 3 + .../package-bootable-glow-cloud-pom.xml | 1 + .../package-bootable-glow-pom.xml | 1 + .../test-project/package-bootable-pom.xml | 4 + .../package-bootable-root-pom.xml | 4 + .../plugin/provision/ProvisionTest.java | 3 + .../resources/test-project/provision-pom.xml | 4 + tests/pom.xml | 91 ++++++++++++++++--- ...stractProvisionConfiguredMojoTestCase.java | 10 ++ tests/standalone-tests/pom.xml | 21 ----- .../wildfly/plugin/provision/ImageTest.java | 3 + .../LayersServerConfigImageTest.java | 3 + .../wildfly/plugin/provision/PackageTest.java | 2 +- .../plugin/provision/ProvisionTest.java | 3 + .../provision/ServerConfigImageTest.java | 3 + .../image-layers-server-config-pom.xml | 4 + .../test/resources/test-project/image-pom.xml | 4 + .../test-project/image-server-config-pom.xml | 4 + .../image-unknown-docker-binary-pom.xml | 4 + .../test-project/package-channel-glow-pom.xml | 4 + .../package-default-config-pom.xml | 4 + .../package-glow-no-deployment-pom.xml | 5 + .../test-project/package-glow-pom.xml | 5 + .../package-invalid-deployment-pom.xml | 4 + .../package-invalid-deployment2-pom.xml | 4 + ...ckage-multiple-deployments-missing-pom.xml | 4 + .../package-multiple-deployments-pom.xml | 4 + .../package-no-deployment-pom.xml | 4 + .../package-no-multiple-deployments-pom.xml | 4 + .../resources/test-project/package-pom.xml | 4 + .../resources/test-project/provision-pom.xml | 4 + 33 files changed, 204 insertions(+), 38 deletions(-) diff --git a/.github/workflows/wildfly-build.yml b/.github/workflows/wildfly-build.yml index d0501109..55379d3c 100644 --- a/.github/workflows/wildfly-build.yml +++ b/.github/workflows/wildfly-build.yml @@ -50,7 +50,7 @@ jobs: distribution: 'temurin' cache: 'maven' - name: Build with Maven Java ${{ matrix.java }} - run: mvn clean install '-Dorg.jboss.logmanager.nocolor=true' '-Dserver.version=${{steps.wildfly-nightly.outputs.wildfly-version}}' + run: mvn clean install '-Dorg.jboss.logmanager.nocolor=true' '-Dversion.org.wildfly=${{steps.wildfly-nightly.outputs.wildfly-version}}' - name: Upload surefire reports uses: actions/upload-artifact@v4 if: failure() diff --git a/pom.xml b/pom.xml index 0bf2c4e7..1491cfd5 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 25.0.2.Final 1.0.0.Final - 32.0.1.Final + 1.2.1.Final 1.3.0.Final @@ -99,8 +99,9 @@ 11 - 11 - 11 + 11 + ${maven.compiler.release} + ${maven.compiler.release} 6.0.4.Final @@ -116,7 +117,7 @@ WildFly wildfly 6.2 - ${version.org.wildfly} + 35.0.0.Final scm:git://github.com/wildfly/wildfly-maven-plugin.git scm:git:git@github.com:wildfly/wildfly-maven-plugin.git @@ -519,6 +520,15 @@ + + wildfly-34 + + (,17) + + + 34.0.1.Final + + release diff --git a/tests/bootable-tests/src/test/java/org/wildfly/plugin/bootable/PackageBootableTest.java b/tests/bootable-tests/src/test/java/org/wildfly/plugin/bootable/PackageBootableTest.java index 514dbded..55c64b79 100644 --- a/tests/bootable-tests/src/test/java/org/wildfly/plugin/bootable/PackageBootableTest.java +++ b/tests/bootable-tests/src/test/java/org/wildfly/plugin/bootable/PackageBootableTest.java @@ -11,9 +11,12 @@ import org.apache.maven.plugin.Mojo; import org.apache.maven.plugin.MojoExecutionException; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.AbstractProvisionConfiguredMojoTestCase; import org.wildfly.plugin.tests.AbstractWildFlyMojoTest; +@Category(ChannelsRequired.class) public class PackageBootableTest extends AbstractProvisionConfiguredMojoTestCase { private static final String BOOTABLE_JAR_NAME = "server-bootable.jar"; diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-cloud-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-cloud-pom.xml index 9cc9b7f2..8f82798e 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-cloud-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-cloud-pom.xml @@ -23,6 +23,7 @@ server-bootable.jar cloud + WF_VERSION diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml index a0f05890..566443f3 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-glow-pom.xml @@ -25,6 +25,7 @@ openapi + WF_VERSION diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml index 7d54c645..1aef91c1 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-pom.xml @@ -44,6 +44,10 @@ packaged-bootable-server true true + + + true + diff --git a/tests/bootable-tests/src/test/resources/test-project/package-bootable-root-pom.xml b/tests/bootable-tests/src/test/resources/test-project/package-bootable-root-pom.xml index 17f5e1c2..f536a0cb 100644 --- a/tests/bootable-tests/src/test/resources/test-project/package-bootable-root-pom.xml +++ b/tests/bootable-tests/src/test/resources/test-project/package-bootable-root-pom.xml @@ -43,6 +43,10 @@ packaged-root-bootable-server true jar-root.jar + + + true + diff --git a/tests/domain-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java b/tests/domain-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java index 83edf691..0bb0e960 100644 --- a/tests/domain-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java +++ b/tests/domain-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java @@ -8,9 +8,12 @@ import org.apache.maven.plugin.Mojo; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.AbstractProvisionConfiguredMojoTestCase; import org.wildfly.plugin.tests.AbstractWildFlyMojoTest; +@Category(ChannelsRequired.class) public class ProvisionTest extends AbstractProvisionConfiguredMojoTestCase { public ProvisionTest() { diff --git a/tests/domain-tests/src/test/resources/test-project/provision-pom.xml b/tests/domain-tests/src/test/resources/test-project/provision-pom.xml index baffa910..01e26d45 100644 --- a/tests/domain-tests/src/test/resources/test-project/provision-pom.xml +++ b/tests/domain-tests/src/test/resources/test-project/provision-pom.xml @@ -24,6 +24,10 @@ false + + + true + diff --git a/tests/pom.xml b/tests/pom.xml index 3f0d6a53..be7334d1 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -28,6 +28,12 @@ ${project.build.directory}${file.separator}wildfly ${project.build.testOutputDirectory} + + org.wildfly + wildfly-ee-galleon-pack + + org.wildfly.channels + wildfly-ee @@ -36,6 +42,19 @@ ${project.groupId} wildfly-maven-plugin ${project.version} + + + + ${wildfly.feature.pack.groupId} + ${wildfly.feature.pack.artifactId} + ${version.org.wildfly} + + + ${project.build.directory}/wildfly + + ${plugin.fork.embedded} + + provision-wildfly @@ -43,17 +62,6 @@ provision - - - - wildfly@maven(org.jboss.universe:community-universe)#${version.org.wildfly} - - - ${project.build.directory}/wildfly - - ${plugin.fork.embedded} - - @@ -73,5 +81,66 @@ + + + skip-channel-tests + + + skip.channel.tests + + + + + + maven-surefire-plugin + + org.wildfly.plugin.categories.ChannelsRequired + + + + + + + wildfly-channels + + + !version.org.wildfly + + + + + + + ${project.groupId} + wildfly-maven-plugin + ${project.version} + + + provision-wildfly + generate-test-resources + + provision + + + + + + + ${wildfly.channel.manifest.groupId} + ${wildfly.channel.manifest.artifactId} + ${version.org.wildfly} + + + + + + + + + + + diff --git a/tests/shared/src/main/java/org/wildfly/plugin/tests/AbstractProvisionConfiguredMojoTestCase.java b/tests/shared/src/main/java/org/wildfly/plugin/tests/AbstractProvisionConfiguredMojoTestCase.java index 5ecbe2de..5c35ef78 100644 --- a/tests/shared/src/main/java/org/wildfly/plugin/tests/AbstractProvisionConfiguredMojoTestCase.java +++ b/tests/shared/src/main/java/org/wildfly/plugin/tests/AbstractProvisionConfiguredMojoTestCase.java @@ -67,6 +67,7 @@ @RunWith(JUnit4.class) public abstract class AbstractProvisionConfiguredMojoTestCase extends AbstractMojoTestCase { private static final String TEST_REPLACE_WF_VERSION = "WF_VERSION"; + private static final String TEST_REPLACE_LOC_WF_VERSION = "#WF_VERSION"; private static final String TEST_REPLACE_BASE_DIR_ABSOLUTE_URL = "WF_BASE_DIR_ABSOLUTE_URL"; static final String WILDFLY_VERSION = "wildfly.test.version"; private final String artifactId; @@ -151,6 +152,15 @@ protected Mojo lookupConfiguredMojo(final Path pom, final String goal) throws Ex private void patchPomFile(final Path pom) throws IOException { StringBuilder content = new StringBuilder(); for (String s : Files.readAllLines(pom)) { + if (s.contains(TEST_REPLACE_LOC_WF_VERSION)) { + String version = System.getProperty(WILDFLY_VERSION); + if (version == null || version.isBlank()) { + version = ""; + } else { + version = "#" + version; + } + s = s.replace(TEST_REPLACE_LOC_WF_VERSION, version); + } if (s.contains(TEST_REPLACE_WF_VERSION)) { s = s.replace(TEST_REPLACE_WF_VERSION, System.getProperty(WILDFLY_VERSION)); } diff --git a/tests/standalone-tests/pom.xml b/tests/standalone-tests/pom.xml index e2a222da..c9bedd46 100644 --- a/tests/standalone-tests/pom.xml +++ b/tests/standalone-tests/pom.xml @@ -124,25 +124,4 @@ - - - - skip-channel-tests - - - skip.channel.tests - - - - - - maven-surefire-plugin - - org.wildfly.plugin.categories.ChannelsRequired - - - - - - diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ImageTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ImageTest.java index 230659eb..883bcea5 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ImageTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ImageTest.java @@ -17,9 +17,12 @@ import org.apache.maven.plugin.MojoExecutionException; import org.junit.Assume; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.AbstractWildFlyMojoTest; import org.wildfly.plugin.tests.TestEnvironment; +@Category(ChannelsRequired.class) public class ImageTest extends AbstractImageTest { @Test diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/LayersServerConfigImageTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/LayersServerConfigImageTest.java index 5de4de8b..8bea838d 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/LayersServerConfigImageTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/LayersServerConfigImageTest.java @@ -6,8 +6,11 @@ import org.junit.Assume; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.TestEnvironment; +@Category(ChannelsRequired.class) public class LayersServerConfigImageTest extends AbstractImageTest { @Test diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/PackageTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/PackageTest.java index 4912068a..0de10d9e 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/PackageTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/PackageTest.java @@ -16,6 +16,7 @@ import org.wildfly.plugin.tests.AbstractProvisionConfiguredMojoTestCase; import org.wildfly.plugin.tests.AbstractWildFlyMojoTest; +@Category(ChannelsRequired.class) public class PackageTest extends AbstractProvisionConfiguredMojoTestCase { public PackageTest() { @@ -38,7 +39,6 @@ public void testPackage() throws Exception { } @Test - @Category(ChannelsRequired.class) public void testPackageWithChannel() throws Exception { final Mojo packageMojo = lookupConfiguredMojo(AbstractWildFlyMojoTest.getPomFile("package-channel-pom.xml").toFile(), diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java index 51873129..574b5eed 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ProvisionTest.java @@ -8,9 +8,12 @@ import org.apache.maven.plugin.Mojo; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.AbstractProvisionConfiguredMojoTestCase; import org.wildfly.plugin.tests.AbstractWildFlyMojoTest; +@Category(ChannelsRequired.class) public class ProvisionTest extends AbstractProvisionConfiguredMojoTestCase { public ProvisionTest() { diff --git a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ServerConfigImageTest.java b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ServerConfigImageTest.java index 170f4ed2..4cf4bdfc 100644 --- a/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ServerConfigImageTest.java +++ b/tests/standalone-tests/src/test/java/org/wildfly/plugin/provision/ServerConfigImageTest.java @@ -6,8 +6,11 @@ import org.junit.Assume; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.wildfly.plugin.categories.ChannelsRequired; import org.wildfly.plugin.tests.TestEnvironment; +@Category(ChannelsRequired.class) public class ServerConfigImageTest extends AbstractImageTest { @Test diff --git a/tests/standalone-tests/src/test/resources/test-project/image-layers-server-config-pom.xml b/tests/standalone-tests/src/test/resources/test-project/image-layers-server-config-pom.xml index d07b4fdd..00999c95 100644 --- a/tests/standalone-tests/src/test/resources/test-project/image-layers-server-config-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/image-layers-server-config-pom.xml @@ -28,6 +28,10 @@ test.war wildfly-image-layers-server-config-maven-plugin standalone-core.xml + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/image-pom.xml b/tests/standalone-tests/src/test/resources/test-project/image-pom.xml index 2088e9d1..44a857d3 100644 --- a/tests/standalone-tests/src/test/resources/test-project/image-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/image-pom.xml @@ -33,6 +33,10 @@ that label-values can span multiple lines. I have "quoted myself" here. + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/image-server-config-pom.xml b/tests/standalone-tests/src/test/resources/test-project/image-server-config-pom.xml index a78489fe..0020ab5a 100644 --- a/tests/standalone-tests/src/test/resources/test-project/image-server-config-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/image-server-config-pom.xml @@ -25,6 +25,10 @@ test.war wildfly-image-server-config-maven-plugin standalone-microprofile.xml + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/image-unknown-docker-binary-pom.xml b/tests/standalone-tests/src/test/resources/test-project/image-unknown-docker-binary-pom.xml index be628bee..1e91992e 100644 --- a/tests/standalone-tests/src/test/resources/test-project/image-unknown-docker-binary-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/image-unknown-docker-binary-pom.xml @@ -27,6 +27,10 @@ image-server wildfly-maven-plugin focker-is-not-docker + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-channel-glow-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-channel-glow-pom.xml index ef839d3a..cc4a49d9 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-channel-glow-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-channel-glow-pom.xml @@ -41,6 +41,10 @@ true packaged-channel-glow-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-default-config-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-default-config-pom.xml index 6d060124..240458ff 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-default-config-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-default-config-pom.xml @@ -23,6 +23,10 @@ true packaged-default-config-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-glow-no-deployment-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-glow-no-deployment-pom.xml index 21e8932d..499c4c2d 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-glow-no-deployment-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-glow-no-deployment-pom.xml @@ -23,7 +23,12 @@ openapi true + WF_VERSION + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-glow-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-glow-pom.xml index 4030ad8c..6f52c164 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-glow-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-glow-pom.xml @@ -23,7 +23,12 @@ openapi + WF_VERSION + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment-pom.xml index c93a662b..8d311829 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment-pom.xml @@ -44,6 +44,10 @@ true packaged-invalid-dep-server true + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment2-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment2-pom.xml index 499e79ee..1852b9cc 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment2-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-invalid-deployment2-pom.xml @@ -45,6 +45,10 @@ true packaged-invalid-dep2-server true + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-missing-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-missing-pom.xml index 44d4b4f9..10709448 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-missing-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-missing-pom.xml @@ -40,6 +40,10 @@ jaxrs-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-pom.xml index 56984052..043ffcba 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-multiple-deployments-pom.xml @@ -60,6 +60,10 @@ jaxrs-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-no-deployment-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-no-deployment-pom.xml index b3d67600..efb6ef76 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-no-deployment-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-no-deployment-pom.xml @@ -31,6 +31,10 @@ true packaged-no-dep-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-no-multiple-deployments-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-no-multiple-deployments-pom.xml index e0ad4733..121bae40 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-no-multiple-deployments-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-no-multiple-deployments-pom.xml @@ -55,6 +55,10 @@ jaxrs-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/package-pom.xml b/tests/standalone-tests/src/test/resources/test-project/package-pom.xml index 56028de5..ee43350e 100644 --- a/tests/standalone-tests/src/test/resources/test-project/package-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/package-pom.xml @@ -43,6 +43,10 @@ true packaged-server + + + true + diff --git a/tests/standalone-tests/src/test/resources/test-project/provision-pom.xml b/tests/standalone-tests/src/test/resources/test-project/provision-pom.xml index 2ebb4b8a..d269fe22 100644 --- a/tests/standalone-tests/src/test/resources/test-project/provision-pom.xml +++ b/tests/standalone-tests/src/test/resources/test-project/provision-pom.xml @@ -26,6 +26,10 @@ false provisioned-server + + + true +