Skip to content

Commit

Permalink
Merge pull request OpenLiberty#1785 from cherylking/removeWarning
Browse files Browse the repository at this point in the history
Change warnings to info or debug
  • Loading branch information
cherylking authored Jan 11, 2024
2 parents 2c4c244 + 31081aa commit 4ee535e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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";
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand Down

0 comments on commit 4ee535e

Please sign in to comment.