Skip to content

Commit

Permalink
Merge pull request #4225 from gastaldi/ban_deps
Browse files Browse the repository at this point in the history
Ban commons-logging, log4j and slf4j implementations from build
  • Loading branch information
gsmet authored Sep 27, 2019
2 parents 35e1bb6 + dfa15ef commit 1026c47
Show file tree
Hide file tree
Showing 17 changed files with 144 additions and 45 deletions.
36 changes: 8 additions & 28 deletions bom/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
<graal-sdk.version>19.2.0.1</graal-sdk.version>
<gizmo.version>1.0.0.Alpha8</gizmo.version>
<jackson.version>2.9.10</jackson.version>
<commons-logging.version>1.2</commons-logging.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.8.1</commons-lang3.version>
<commons-codec.version>1.11</commons-codec.version>
Expand All @@ -89,8 +88,6 @@
<rxjava.version>2.2.9</rxjava.version>
<wildfly.openssl.version>1.0.6.Final</wildfly.openssl.version>
<jboss-logging-annotations.version>2.1.0.Final</jboss-logging-annotations.version>
<log4j.version>1.2.17</log4j.version>
<log4j2.version>2.11.2</log4j2.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j-jboss-logging.version>1.2.0.Final</slf4j-jboss-logging.version>
<wildfly-common.version>1.5.0.Final-format-001</wildfly-common.version>
Expand Down Expand Up @@ -726,11 +723,6 @@
</dependency>

<!-- Additional dependencies, keep in alphabetical order -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -873,6 +865,10 @@
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -894,6 +890,10 @@
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -1137,11 +1137,6 @@
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs-api.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
Expand Down Expand Up @@ -1187,21 +1182,6 @@
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
Expand Down
15 changes: 15 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@
<exclude>jakarta.json:jakarta.json-api</exclude>
<!-- Ensure none of the deps use netty-all. This forces deps to use more fine grained netty artifacts -->
<exclude>io.netty:netty-all</exclude>
<!-- Ban Log4J (use org.jboss.logmanager:log4j-jboss-logmanager instead) -->
<exclude>log4j:log4j</exclude>
<exclude>org.apache.logging.log4j:log4j-api</exclude>
<exclude>org.apache.logging.log4j:log4j-core</exclude>
<exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
<!-- Ban commons-logging (use org.jboss.logging:commons-logging-jboss-logging instead) -->
<exclude>commons-logging:commons-logging</exclude>
<exclude>commons-logging:commons-logging-api</exclude>
<exclude>org.springframework:spring-jcl</exclude>
<!-- Ban SLF4j implementations (use org.jboss.slf4j:slf4j-jboss-logmanager instead) -->
<exclude>org.slf4j:slf4j-simple</exclude>
<exclude>org.slf4j:slf4j-nop</exclude>
<exclude>org.slf4j:slf4j-jdk14</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.slf4j:slf4j-log4j13</exclude>
</excludes>
</bannedDependencies>
</rules>
Expand Down
11 changes: 11 additions & 0 deletions devtools/maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
<version>2.3.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logging</artifactId>
</dependency>

<!-- test -->
Expand Down
11 changes: 10 additions & 1 deletion extensions/amazon-lambda-resteasy/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-core</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy;
import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
import org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory;
import org.apache.commons.logging.impl.Jdk14Logger;
import org.apache.commons.logging.impl.LogFactoryImpl;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.logging.Logger;
Expand Down Expand Up @@ -48,9 +46,6 @@ public class ArtemisCoreProcessor {
void build(CombinedIndexBuildItem indexBuildItem,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {

reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
LogFactoryImpl.class.getName(), Jdk14Logger.class.getName()));

Collection<ClassInfo> connectorFactories = indexBuildItem.getIndex()
.getAllKnownImplementors(DotName.createSimple(ConnectorFactory.class.getName()));

Expand Down
11 changes: 11 additions & 0 deletions extensions/artemis-core/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;

class ElasticsearchRestClientProcessor {

@BuildStep
public void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<ExtensionSslNativeSupportBuildItem> extensionSslNativeSupport) throws Exception {
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
org.apache.commons.logging.impl.LogFactoryImpl.class.getName(),
org.apache.commons.logging.impl.Jdk14Logger.class.getName()));

public void build(BuildProducer<ExtensionSslNativeSupportBuildItem> extensionSslNativeSupport) {
// Indicates that this extension would like the SSL support to be enabled
extensionSslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(FeatureBuildItem.ELASTICSEARCH_REST_CLIENT));
}
Expand Down
16 changes: 16 additions & 0 deletions extensions/elasticsearch-rest-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,26 @@
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client-sniffer</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import javax.ws.rs.client.ClientResponseFilter;
import javax.ws.rs.ext.Providers;

import org.apache.commons.logging.impl.Jdk14Logger;
import org.apache.commons.logging.impl.LogFactoryImpl;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
Expand Down Expand Up @@ -111,8 +109,6 @@ void setup(BuildProducer<FeatureBuildItem> feature,
additionalBeans.produce(new AdditionalBeanBuildItem(RestClient.class));

reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
LogFactoryImpl.class.getName(),
Jdk14Logger.class.getName(),
DefaultResponseExceptionMapper.class.getName(),
AsyncInterceptorRxInvokerProvider.class.getName(),
ResteasyProviderFactoryImpl.class.getName(),
Expand Down
10 changes: 10 additions & 0 deletions extensions/rest-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
Expand Down
10 changes: 10 additions & 0 deletions extensions/smallrye-fault-tolerance/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-metrics</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/artemis-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/artemis-jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/infinispan-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-server</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
8 changes: 8 additions & 0 deletions tcks/microprofile-health/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
</dependencies>

</project>
10 changes: 10 additions & 0 deletions tcks/microprofile-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
<groupId>org.eclipse.microprofile.openapi</groupId>
<artifactId>microprofile-openapi-tck</artifactId>
<version>${microprofile-open-api.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions test-framework/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</dependency>
<!-- Needed for RestAssured -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down

0 comments on commit 1026c47

Please sign in to comment.