diff --git a/docs/dev.md b/docs/dev.md index 19a8b9576..ebb805e8a 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -6,7 +6,8 @@ Start a Liberty instance in dev mode. This goal also invokes the `create`, `inst Starting in version 3.6.1, dev mode invokes the `generate-features` goal when the `generateFeatures` configuration parameter is set to `true`. **This goal modifies the source configuration directory of your application.** See [generate-features](generate-features.md) for details. The default value for the `generateFeatures` parameter is `false`. When auto-generation of features is turned on, dev mode has a runtime dependency on IBM WebSphere Application Server Migration Toolkit for Application Binaries, which is separately licensed under IBM License Agreement for Non-Warranted Programs. For more information, see the [license](https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/wamt). -Additionally, starting in 3.5.2-SNAPSHOT, [resource variable filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) and [WAR overlays](https://maven.apache.org/plugins/maven-war-plugin/overlays.html) are supported for loose WAR applications. This is done by automatically detecting appropriate Maven WAR plugin configuration and calling the WAR plugin's `exploded` goal and the Maven Resource plugin's `resource` goal when appropriate. Behavior for updating/deleting resources is delegated via the Maven WAR plugin configuration, including the `outdatedCheckPath` parameter enhanced in plugin version 3.3.2. +Additionally, starting in version 3.5.2, [resource variable filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) and [WAR overlays](https://maven.apache.org/plugins/maven-war-plugin/overlays.html) are supported for loose WAR applications. This is done by automatically detecting appropriate Maven WAR plugin configuration and calling the WAR plugin's `exploded` goal and the Maven Resource plugin's `resource` goal when appropriate. Behavior for updating/deleting resources can be configured via the [`outdatedCheckPath`](https://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html#outdatedCheckPath) parameter introduced and then enhanced in maven-war-plugin versions 3.3.1, 3.3.2. + To start the server in a container, see the [devc](#devc-container-mode) section below. diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java index 23c1e5083..4501331bf 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java @@ -146,8 +146,9 @@ protected void installLooseConfigWar(MavenProject proj, LooseConfigData config, // Validate maven-war-plugin version Plugin warPlugin = getPlugin("org.apache.maven.plugins", "maven-war-plugin"); - if (!validatePluginVersion(warPlugin.getVersion(), "3.3.1")) { - getLog().warn("Exploded WAR functionality is enabled. Please use maven-war-plugin version 3.3.1 or greater for best results."); + if (!validatePluginVersion(warPlugin.getVersion(), "3.3.2")) { + getLog().warn( + "Exploded WAR functionality is enabled. Please use maven-war-plugin version 3.3.2 or greater for best results."); } // Don't especially need to run it exactly here, but in debugger we can see what we have diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/DevMojo.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/DevMojo.java index ea5f76156..88c70d024 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/DevMojo.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/DevMojo.java @@ -773,8 +773,9 @@ protected void updateLooseApp() throws PluginExecutionException { // Validate maven-war-plugin version Plugin warPlugin = getPlugin("org.apache.maven.plugins", "maven-war-plugin"); - if (!validatePluginVersion(warPlugin.getVersion(), "3.3.1")) { - getLog().warn("Exploded WAR functionality is enabled. Please use maven-war-plugin version 3.3.1 or greater for best results."); + if (!validatePluginVersion(warPlugin.getVersion(), "3.3.2")) { + getLog().warn( + "Exploded WAR functionality is enabled. Please use maven-war-plugin version 3.3.2 or greater for best results."); } redeployApp(); diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/StartDebugMojoSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/StartDebugMojoSupport.java index b297e0615..ea25d2321 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/StartDebugMojoSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/StartDebugMojoSupport.java @@ -201,9 +201,14 @@ protected void runExplodedMojo() throws MojoExecutionException { Plugin warPlugin = getPlugin("org.apache.maven.plugins", "maven-war-plugin"); Xpp3Dom explodedConfig = ExecuteMojoUtil.getPluginGoalConfig(warPlugin, "exploded", getLog()); - if (validatePluginVersion(warPlugin.getVersion(), "3.3.1")) { - explodedConfig.addChild(element(name("outdatedCheckPath"), "WEB-INF").toDom()); + if (explodedConfig.getChild("outdatedCheckPath") == null) { + if (validatePluginVersion(warPlugin.getVersion(), "3.3.2")) { + explodedConfig.addChild(element(name("outdatedCheckPath"), "/").toDom()); + } else if (validatePluginVersion(warPlugin.getVersion(), "3.3.1")) { + explodedConfig.addChild(element(name("outdatedCheckPath"), "WEB-INF").toDom()); + } } + getLog().info("Running maven-war-plugin:exploded"); getLog().debug("configuration:\n" + explodedConfig); session.getRequest().setStartTime(new Date()); diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/utils/ExecuteMojoUtil.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/utils/ExecuteMojoUtil.java index f45857b03..ed4cb5055 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/utils/ExecuteMojoUtil.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/utils/ExecuteMojoUtil.java @@ -141,7 +141,7 @@ public class ExecuteMojoUtil { // https://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html private static final ArrayList EXPLODED_PARAMS = new ArrayList<>(Arrays.asList( "filteringDeploymentDescriptors", "warSourceDirectory", "webappDirectory", "workDirectory", "filters", - "overlays", "webResources" + "outdatedCheckPath", "overlays", "webResources" )); // https://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html