From 823af74874acca2e36c76422c67c4bc3e3c358fe Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Tue, 2 Jun 2020 13:28:57 +0200 Subject: [PATCH] Replace logback-classic with slf4j-simple in the client get a smaller excutable and easier log config --- client/pom.xml | 10 +++++----- .../jboss/fuse/mvnd/client/ClientLayout.java | 17 ++++++++++++++++- .../mvnd/client/svm/ReflectionRegistration.java | 15 +++++++++++++++ daemon/pom.xml | 10 ++++++++++ pom.xml | 5 +++++ 5 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 client/src/main/java/org/jboss/fuse/mvnd/client/svm/ReflectionRegistration.java diff --git a/client/pom.xml b/client/pom.xml index 7613ab1a..92ac0919 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -15,11 +15,6 @@ - - ch.qos.logback - logback-classic - - org.graalvm.nativeimage svm @@ -34,6 +29,11 @@ jline-terminal-jansi + + org.slf4j + slf4j-simple + + org.junit.jupiter junit-jupiter diff --git a/client/src/main/java/org/jboss/fuse/mvnd/client/ClientLayout.java b/client/src/main/java/org/jboss/fuse/mvnd/client/ClientLayout.java index 626b2fc7..305bd42f 100644 --- a/client/src/main/java/org/jboss/fuse/mvnd/client/ClientLayout.java +++ b/client/src/main/java/org/jboss/fuse/mvnd/client/ClientLayout.java @@ -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=" diff --git a/client/src/main/java/org/jboss/fuse/mvnd/client/svm/ReflectionRegistration.java b/client/src/main/java/org/jboss/fuse/mvnd/client/svm/ReflectionRegistration.java new file mode 100644 index 00000000..5bfd6dee --- /dev/null +++ b/client/src/main/java/org/jboss/fuse/mvnd/client/svm/ReflectionRegistration.java @@ -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); +// } + } +} diff --git a/daemon/pom.xml b/daemon/pom.xml index 1a762d6d..a3027307 100644 --- a/daemon/pom.xml +++ b/daemon/pom.xml @@ -14,9 +14,19 @@ Maven Daemon + + ch.qos.logback + logback-classic + org.jboss.fuse.mvnd mvnd-client + + + org.slf4j + slf4j-simple + + org.apache.maven diff --git a/pom.xml b/pom.xml index d48d40a1..21ccf9a0 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,11 @@ logback-classic ${logback.version} + + org.slf4j + slf4j-simple + ${slf4j.version} + org.codehaus.groovy