Skip to content

Commit

Permalink
removed log4j dependencies and added slf4j bridges
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleisch committed Dec 16, 2021
1 parent 7f30f13 commit a3ad947
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,12 @@ allprojects {

annotationProcessor "de.unijena.bioinf.ms:processor:$siriusVersion"
compile 'net.sf.trove4j:core:3.1.0'
//switched from 'net.sf.trove4j:trove4j:3.0.3' which seems to be buggy and no longer supported

compile "org.jetbrains:annotations:$jetbrains_version"
compile group: 'org.slf4j', name: 'slf4j-api', version: "$slf4j_version"

compile "org.slf4j:log4j-over-slf4j:$slf4j_version"
compile "org.slf4j:jcl-over-slf4j:$slf4j_version"
compile "org.slf4j:slf4j-api:$slf4j_version"

testCompile group: 'junit', name: 'junit', version: '4.12'

Expand All @@ -143,6 +146,15 @@ allprojects {
// compile "cplex:cplex:12.7.1"
}

configurations {
//replaced by log4j-over-slf4j
runtime.exclude group: "log4j", module: "log4j"
compile.exclude group: "log4j", module: "log4j"
//replaced by jcl-over-slf4j
runtime.exclude group: "commons-logging", module: "commons-logging"
compile.exclude group: "commons-logging", module: "commons-logging"
}

//there are some outdated incompatible trove dependencies in some libs.
// this is to exclude them and enforce the one we need.
configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import de.unijena.bioinf.webapi.WebAPI;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.log4j.Level;
import org.jbibtex.BibTeXDatabase;
import org.jbibtex.BibTeXParser;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -81,13 +80,6 @@ public static void measureTime(String message) {
t1 = System.currentTimeMillis();
measureTime("Start AppCore");
try {
// System.setProperty("de.unijena.bioinf.jjobs.DEBUG", "true");

// System.out.println("LD ==> " + System.getProperty("java.library.path"));
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
org.apache.log4j.Logger.getLogger("net.sf.jnati").setLevel(Level.WARN);


System.setProperty("de.unijena.bioinf.ms.propertyLocations", "sirius_frontend.build.properties");

final String version = PropertyManager.getProperty("de.unijena.bioinf.siriusFrontend.version");
Expand Down
1 change: 1 addition & 0 deletions sirius_cli/src/main/resources/logging.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ java.awt.level=WARNING
sun.awt.level=WARNING
javax.swing.level=WARNING
org.reflections8.level=SEVERE
net.sf.jnati.level=WARNING
# Handlers
# -----------------------------------------
# --- ConsoleHandler ---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#here you can provide properties that may be needed during build- AND during runtime and should not be editable by the user at runtime
de.unijena.bioinf.siriusFrontend.version=4.9.11-SNAPSHOT
de.unijena.bioinf.siriusFrontend.version=4.9.12-SNAPSHOT

de.unijena.bioinf.sirius.version=4.6.1
de.unijena.bioinf.fingerid.version=1.6.0
Expand Down

0 comments on commit a3ad947

Please sign in to comment.