diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f02835fb8..5c5bb1be0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -22,7 +22,7 @@ jobs: matrix: # test against latest update of each major Java version, as well as specific updates of LTS versions: RUNTIME: [ol, wlp] - RUNTIME_VERSION: [23.0.0.10] + RUNTIME_VERSION: [23.0.0.12] java: [21, 17, 11, 8] exclude: - java: 8 @@ -80,7 +80,7 @@ jobs: matrix: # test against latest update of each major Java version, as well as specific updates of LTS versions: RUNTIME: [ol, wlp] - RUNTIME_VERSION: [23.0.0.10] + RUNTIME_VERSION: [23.0.0.12] java: [21, 17, 11, 8] exclude: - java: 8 diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunInstallEarTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunInstallEarTest.java index e77a8ab38..3ab9b641f 100644 --- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunInstallEarTest.java +++ b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/MultiModuleRunInstallEarTest.java @@ -51,29 +51,39 @@ public static void setUpBeforeClass() throws Exception { */ @Test public void notOverwriteExistingM2Test() throws Exception { - // Check that the file was already created (from the run() during setup) - File ear = new File(System.getProperty("user.home"), ".m2/repository/io/openliberty/guides/guide-maven-multimodules-ear/1.0-SNAPSHOT/guide-maven-multimodules-ear-1.0-SNAPSHOT.ear"); - assertTrue(ear.exists()); - long lastModified = ear.lastModified(); - waitLongEnough(); - - // Install the real EAR file through Maven command - runMvnInstallEar(); - - // Check file is updated - long newModified = ear.lastModified(); - assertNotEquals(lastModified, newModified); - waitLongEnough(); - - // Cleanup (stop Liberty) - cleanUpAfterClass(false); - - // Setup and run Liberty again - setUpBeforeClass(); - - // Check file is not overwritten by liberty:run - long newModified2 = ear.lastModified(); - assertEquals(newModified2, newModified); + // Check that the file was already created (from the run() during setup) + // Note: The 'run' command does not actually install the app to .m2 since it is using loose app. Sometimes the ear file is already there from + // another dev test though that did a 'mvn install'. + long newModified = 0; + File ear = new File(System.getProperty("user.home"), ".m2/repository/io/openliberty/guides/guide-maven-multimodules-ear/1.0-SNAPSHOT/guide-maven-multimodules-ear-1.0-SNAPSHOT.ear"); + if (ear.exists()) { + long lastModified = ear.lastModified(); + waitLongEnough(); + + // Install the real EAR file through Maven command + runMvnInstallEar(); + + // Check file is updated + newModified = ear.lastModified(); + assertNotEquals(lastModified, newModified); + + } else { + // Install the real EAR file through Maven command + runMvnInstallEar(); + newModified = ear.lastModified(); + } + + waitLongEnough(); + + // Cleanup (stop Liberty) + cleanUpAfterClass(false); + + // Setup and run Liberty again + setUpBeforeClass(); + + // Check file is not overwritten by liberty:run + long newModified2 = ear.lastModified(); + assertEquals(newModified2, newModified); } private static void runMvnInstallEar() throws Exception { diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java index 01ed846e6..b8425cbdb 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java @@ -172,6 +172,7 @@ protected void installDependencies() throws MojoExecutionException, IOException for (Artifact artifact : artifacts) { // skip if not an application type supported by Liberty if (!isSupportedType(artifact.getType())) { + getLog().debug("Skipping install of dependency "+artifact.getArtifactId()+" with unsupported type: "+artifact.getType()); continue; } // skip assemblyArtifact if specified as a dependency 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 a909ef918..442b2a06f 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 @@ -548,7 +548,7 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { // copy server.xml file to server directory if end-user explicitly set it. if (serverXmlFile != null && serverXmlFile.exists()) { if (serverXMLPath != null && ! serverXmlFile.getCanonicalPath().equals(serverXMLPath)) { - getLog().warn("The " + serverXMLPath + " file is overwritten by the "+serverXmlFile.getCanonicalPath()+" file."); + getLog().info("The " + serverXMLPath + " file is overwritten by the "+serverXmlFile.getCanonicalPath()+" file."); } Copy copy = (Copy) ant.createTask("copy"); copy.setFile(serverXmlFile); @@ -563,20 +563,20 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { if (optionsFile.exists() && jvmOptionsPath == null) { // if using pre-existing installation, do not delete file if (installType != InstallType.ALREADY_EXISTS) { - getLog().warn(optionsFile.getCanonicalPath() + " file deleted before processing plugin configuration."); + getLog().info(optionsFile.getCanonicalPath() + " file deleted before processing plugin configuration."); optionsFile.delete(); } } if (jvmOptions != null || !jvmMavenPropValues.isEmpty()) { if (jvmOptionsPath != null) { - getLog().warn("The " + jvmOptionsPath + " file is overwritten by inlined configuration."); + getLog().info("The " + jvmOptionsPath + " file is overwritten by inlined configuration."); } jvmOptionsResolved = handleLatePropertyResolution(jvmOptions); writeJvmOptions(optionsFile, jvmOptionsResolved, jvmMavenPropValues); jvmOptionsPath = "inlined configuration"; } else if (jvmOptionsFile != null && jvmOptionsFile.exists()) { if (jvmOptionsPath != null) { - getLog().warn("The " + jvmOptionsPath + " file is overwritten by the "+jvmOptionsFile.getCanonicalPath()+" file."); + getLog().info("The " + jvmOptionsPath + " file is overwritten by the "+jvmOptionsFile.getCanonicalPath()+" file."); } Copy copy = (Copy) ant.createTask("copy"); copy.setFile(jvmOptionsFile); @@ -591,20 +591,20 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { if (bootstrapFile.exists() && bootStrapPropertiesPath == null) { // if using pre-existing installation, do not delete file if (installType != InstallType.ALREADY_EXISTS) { - getLog().warn(bootstrapFile.getCanonicalPath() + " file deleted before processing plugin configuration."); + getLog().info(bootstrapFile.getCanonicalPath() + " file deleted before processing plugin configuration."); bootstrapFile.delete(); } } if (bootstrapProperties != null || !bootstrapMavenProps.isEmpty()) { if (bootStrapPropertiesPath != null) { - getLog().warn("The " + bootStrapPropertiesPath + " file is overwritten by inlined configuration."); + getLog().info("The " + bootStrapPropertiesPath + " file is overwritten by inlined configuration."); } bootstrapPropertiesResolved = handleLatePropertyResolution(bootstrapProperties); writeBootstrapProperties(bootstrapFile, bootstrapPropertiesResolved, bootstrapMavenProps); bootStrapPropertiesPath = "inlined configuration"; } else if (bootstrapPropertiesFile != null && bootstrapPropertiesFile.exists()) { if (bootStrapPropertiesPath != null) { - getLog().warn("The " + bootStrapPropertiesPath + " file is overwritten by the "+ bootstrapPropertiesFile.getCanonicalPath()+" file."); + getLog().info("The " + bootStrapPropertiesPath + " file is overwritten by the "+ bootstrapPropertiesFile.getCanonicalPath()+" file."); } Copy copy = (Copy) ant.createTask("copy"); copy.setFile(bootstrapPropertiesFile); @@ -626,7 +626,7 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { // Do a special case merge but ONLY if there are no other config options present envPropsToWrite = mergeSpecialPropsFromInstallServerEnvIfAbsent(envMavenProps); } else if (serverEnvPath != null) { - getLog().warn("The " + serverEnvPath + " file is overwritten by inlined configuration."); + getLog().info("The " + serverEnvPath + " file is overwritten by inlined configuration."); } writeServerEnvProperties(envFile, envPropsToWrite); serverEnvPath = "inlined configuration"; @@ -642,7 +642,7 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { File pluginVariableConfig = new File(serverDirectory, PLUGIN_VARIABLE_CONFIG_OVERRIDES_XML); if (pluginVariableConfig.exists()) { - getLog().warn(pluginVariableConfig.getCanonicalPath() + " file deleted before processing plugin configuration."); + getLog().debug(pluginVariableConfig.getCanonicalPath() + " file deleted before processing plugin configuration."); pluginVariableConfig.delete(); } if (!varMavenProps.isEmpty()) { @@ -651,7 +651,7 @@ protected void copyConfigFiles() throws IOException, MojoExecutionException { pluginVariableConfig = new File(serverDirectory, PLUGIN_VARIABLE_CONFIG_DEFAULTS_XML); if (pluginVariableConfig.exists()) { - getLog().warn(pluginVariableConfig.getCanonicalPath() + " file deleted before processing plugin configuration."); + getLog().debug(pluginVariableConfig.getCanonicalPath() + " file deleted before processing plugin configuration."); pluginVariableConfig.delete(); } if (!defaultVarMavenProps.isEmpty()) {