File tree Expand file tree Collapse file tree 10 files changed +16
-34
lines changed
src/main/java/org/owasp/dependencycheck/taskdefs
java/org/owasp/dependencycheck
src/main/java/org/owasp/dependencycheck/data/cache
src/main/java/org/owasp/dependencycheck/maven Expand file tree Collapse file tree 10 files changed +16
-34
lines changed Original file line number Diff line number Diff line change @@ -222,10 +222,6 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
222222 <groupId >org.slf4j</groupId >
223223 <artifactId >slf4j-api</artifactId >
224224 </dependency >
225- <dependency >
226- <groupId >io.github.jeremylong</groupId >
227- <artifactId >jcs3-slf4j</artifactId >
228- </dependency >
229225 <dependency >
230226 <groupId >org.owasp</groupId >
231227 <artifactId >dependency-check-core</artifactId >
Original file line number Diff line number Diff line change 1717 */
1818package org .owasp .dependencycheck .taskdefs ;
1919
20- import io .github .jeremylong .jcs3 .slf4j .Slf4jAdapter ;
2120import java .io .File ;
2221import java .io .IOException ;
2322import java .io .InputStream ;
@@ -128,9 +127,6 @@ public final void execute() throws BuildException {
128127 * Hacky method of muting the noisy logging from JCS.
129128 */
130129 private void muteNoisyLoggers () {
131- System .setProperty ("jcs.logSystem" , "slf4j" );
132- Slf4jAdapter .muteLogging (true );
133-
134130 final String [] noisyLoggers = {
135131 "org.apache.hc"
136132 };
Original file line number Diff line number Diff line change @@ -179,10 +179,6 @@ Copyright (c) 2012 - Jeremy Long. All Rights Reserved.
179179 <groupId >org.slf4j</groupId >
180180 <artifactId >slf4j-api</artifactId >
181181 </dependency >
182- <dependency >
183- <groupId >io.github.jeremylong</groupId >
184- <artifactId >jcs3-slf4j</artifactId >
185- </dependency >
186182 <dependency >
187183 <!-- not visible in imports due to method chaining, but App code uses classes from this library -->
188184 <groupId >io.github.jeremylong</groupId >
Original file line number Diff line number Diff line change 4848import ch .qos .logback .classic .spi .ILoggingEvent ;
4949import ch .qos .logback .classic .Level ;
5050import ch .qos .logback .classic .LoggerContext ;
51- import io .github .jeremylong .jcs3 .slf4j .Slf4jAdapter ;
5251import java .util .TreeSet ;
5352import org .owasp .dependencycheck .utils .SeverityUtil ;
5453
@@ -84,10 +83,6 @@ public class App {
8483 */
8584 @ SuppressWarnings ("squid:S4823" )
8685 public static void main (String [] args ) {
87- System .setProperty ("jcs.logSystem" , "slf4j" );
88- if (!LOGGER .isDebugEnabled ()) {
89- Slf4jAdapter .muteLogging (true );
90- }
9186 final int exitCode ;
9287 final App app = new App ();
9388 exitCode = app .run (args );
Original file line number Diff line number Diff line change 1111 </appender >
1212
1313 <logger name =" org.apache.lucene" level =" ERROR" />
14- <logger name =" org.apache.commons.jcs " level =" ERROR " />
14+ <logger name =" org.apache.commons.jcs3 " level =" FATAL " />
1515 <logger name =" org.apache.hc" level =" ERROR" />
1616
1717 <root level =" INFO" >
Original file line number Diff line number Diff line change @@ -197,14 +197,14 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
197197 <groupId >org.whitesource</groupId >
198198 <artifactId >pecoff4j</artifactId >
199199 </dependency >
200- <dependency >
201- <groupId >org.apache.commons</groupId >
202- <artifactId >commons-jcs3-core</artifactId >
203- </dependency >
200+ <!-- JCS 3 logging adapter; intentionally higher on classpath than JCS itself -->
204201 <dependency >
205202 <groupId >io.github.jeremylong</groupId >
206203 <artifactId >jcs3-slf4j</artifactId >
207- <scope >runtime</scope >
204+ </dependency >
205+ <dependency >
206+ <groupId >org.apache.commons</groupId >
207+ <artifactId >commons-jcs3-core</artifactId >
208208 </dependency >
209209 <dependency >
210210 <groupId >com.github.package-url</groupId >
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public class DataCache<T> {
3838 *
3939 * @param cache a reference to the underlying cache implementation.
4040 */
41- public DataCache (CacheAccess <String , T > cache ) {
41+ DataCache (CacheAccess <String , T > cache ) {
4242 this .cache = cache ;
4343 }
4444
Original file line number Diff line number Diff line change 2222import java .io .InputStream ;
2323import java .util .List ;
2424import java .util .Properties ;
25+
26+ import io .github .jeremylong .jcs3 .slf4j .Slf4jAdapter ;
2527import org .apache .commons .jcs3 .JCS ;
2628import org .apache .commons .jcs3 .access .CacheAccess ;
2729import org .apache .commons .jcs3 .access .exception .CacheException ;
@@ -77,6 +79,13 @@ private enum CacheType {
7779 POM
7880 }
7981
82+ static {
83+ System .setProperty ("jcs.logSystem" , "slf4j" );
84+ if (!LOGGER .isTraceEnabled ()) {
85+ Slf4jAdapter .muteLogging (true );
86+ }
87+ }
88+
8089 /**
8190 * Creates the data cache factory.
8291 *
Original file line number Diff line number Diff line change @@ -124,10 +124,6 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
124124 <artifactId >mockito-junit-jupiter</artifactId >
125125 <scope >test</scope >
126126 </dependency >
127- <dependency >
128- <groupId >io.github.jeremylong</groupId >
129- <artifactId >jcs3-slf4j</artifactId >
130- </dependency >
131127 <dependency >
132128 <groupId >org.apache.maven</groupId >
133129 <artifactId >maven-plugin-api</artifactId >
Original file line number Diff line number Diff line change 2020import com .github .packageurl .MalformedPackageURLException ;
2121import com .github .packageurl .PackageURL .StandardTypes ;
2222import com .github .packageurl .PackageURL ;
23- import io .github .jeremylong .jcs3 .slf4j .Slf4jAdapter ;
2423import java .util .stream .Collectors ;
2524import java .util .stream .Stream ;
2625
@@ -2731,11 +2730,6 @@ private String[] determineSuppressions() {
27312730 * Hacky method of muting the noisy logging from JCS
27322731 */
27332732 protected void muteNoisyLoggers () {
2734- System .setProperty ("jcs.logSystem" , "slf4j" );
2735- if (!getLog ().isDebugEnabled ()) {
2736- Slf4jAdapter .muteLogging (true );
2737- }
2738-
27392733 final String [] noisyLoggers = {
27402734 "org.apache.hc"
27412735 };
You can’t perform that action at this time.
0 commit comments