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

@@ -15,11 +15,6 @@
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
@@ -34,6 +29,11 @@
<artifactId>jline-terminal-jansi</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>

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);
// }
}
}

View File

@@ -14,9 +14,19 @@
<name>Maven Daemon</name>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.fuse.mvnd</groupId>
<artifactId>mvnd-client</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@@ -51,6 +51,11 @@
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>