Skip to content

Commit

Permalink
tighten up logging dependencies to use only SLF4J/logback consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
pgalbraith committed Oct 10, 2018
1 parent 8f35958 commit 91f1505
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 4 deletions.
60 changes: 56 additions & 4 deletions crawler4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,31 +151,83 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<!--
Banning JCL because we use SLF4J (and jcl-over-slf4j).
If this occurs in your build you should find what
dependency is bringing in JCL and add an exclusion
rule to prevent it.
-->
<exclude>commons-logging</exclude>
<!--
Banning Log4j because we use SLF4J/Logback. If you
come across this, exclude the Log4j dependency and
add the log4j-over-slf4j library to replace it.
-->
<exclude>log4j</exclude>
<exclude>org.apache.logging.log4j</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>

<!-- Compile time Dependencies -->

<!-- Logging API -->
<dependency>
<!-- Logging framework -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<!-- Implementation of slf4j -->
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>

<!-- Logging Provider -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>

<!-- Compile time Dependencies -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache.http.components.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sleepycat</groupId>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<maven.gmaven.plus.version>1.5</maven.gmaven.plus.version>
<maven.versions.version>2.5</maven.versions.version>
<maven.forbiddenapis.version>2.4.1</maven.forbiddenapis.version>
<maven.enforcer.version>3.0.0-M2</maven.enforcer.version>
</properties>

<profiles>
Expand Down Expand Up @@ -269,6 +270,11 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven.enforcer.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit 91f1505

Please sign in to comment.