Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected void verifyAppStarted(String appFile) throws MojoExecutionException {

try {
Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory,
scd = ServerConfigDocument.getInstance(new CommonLogger(log), serverXML, configDirectory,
bootstrapPropertiesFile, combinedBootstrapProperties, serverEnvFile, false, libertyDirPropertyFiles);

//appName will be set to a name derived from appFile if no name can be found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void undeployApp(File file) throws MojoExecutionException {
File serverXML = new File(serverDirectory.getCanonicalPath(), "server.xml");

Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory,
scd = ServerConfigDocument.getInstance(new CommonLogger(log), serverXML, configDirectory,
bootstrapPropertiesFile, combinedBootstrapProperties, serverEnvFile, false, libertyDirPropertyFiles);

//appName will be set to a name derived from file if no name can be found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected Set<String> getAppConfigLocationsFromSourceServerXml() {
if (serverXML != null && serverXML.exists()) {
try {
Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory,
scd = ServerConfigDocument.getInstance(new CommonLogger(log), serverXML, configDirectory,
bootstrapPropertiesFile, combinedBootstrapProperties, serverEnvFile, false,
libertyDirPropertyFiles);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2019.
* (C) Copyright IBM Corporation 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,7 @@
*/
package io.openliberty.tools.maven.utils;

import org.apache.maven.plugin.logging.Log;
import org.codehaus.mojo.pluginsupport.MojoSupport;

import io.openliberty.tools.common.CommonLoggerI;
Expand All @@ -23,11 +24,8 @@ public class CommonLogger extends MojoSupport implements CommonLoggerI {

private static CommonLogger logger = null;

public static CommonLogger getInstance() {
if (logger == null) {
logger = new CommonLogger();
}
return logger;
public CommonLogger(Log mojoLogger) {
setLog(mojoLogger);
}

@Override
Expand Down Expand Up @@ -71,4 +69,4 @@ public boolean isDebugEnabled() {
return getLog().isDebugEnabled();
}

}
}