Replace logback-classic with slf4j-simple in the client get a smaller excutable and easier log config

This commit is contained in:
Peter Palaga
2020-06-02 13:28:57 +02:00
parent 07559a24df
commit 823af74874
5 changed files with 51 additions and 6 deletions

View File

@@ -22,8 +22,9 @@ public class ClientLayout extends Layout {
final Properties mvndProperties = loadMvndProperties();
final Path pwd = Paths.get(".").toAbsolutePath().normalize();
final Path mvndHome = findMavenHome(mvndProperties);
ENV_INSTANCE = new ClientLayout(
findMavenHome(mvndProperties),
mvndHome,
pwd,
findMultiModuleProjectDirectory(pwd),
findJavaHome(mvndProperties),
@@ -79,6 +80,20 @@ public class ClientLayout extends Layout {
}
}
static Path findLogbackConfigurationFile(Properties mvndProperties, Path mvndHome) {
String rawValue = mvndProperties.getProperty("logback.configurationFile");
if (rawValue == null) {
rawValue = System.getProperty("logback.configurationFile");
}
if (rawValue == null) {
rawValue = System.getProperty("logback.configurationFile");
}
if (rawValue != null) {
return Paths.get(rawValue).toAbsolutePath().normalize();
}
return mvndHome.resolve("conf/logging/logback.xml");
}
@Override
public String toString() {
return "ClientLayout [localMavenRepository=" + localMavenRepository + ", settings=" + settings + ", javaHome="

View File

@@ -0,0 +1,15 @@
package org.jboss.fuse.mvnd.client.svm;
import org.graalvm.nativeimage.hosted.Feature;
import com.oracle.svm.core.annotate.AutomaticFeature;
@AutomaticFeature
public class ReflectionRegistration implements Feature {
public void beforeAnalysis(BeforeAnalysisAccess access) {
// try {
// } catch (NoSuchMethodException | SecurityException e) {
// throw new RuntimeException(e);
// }
}
}