This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new acec5613d8 [SYSTEMDS-3394] Log4j incompatible dependencies
acec5613d8 is described below

commit acec5613d87dce9212ab1226432e7a48d73de0ac
Author: baunsgaard <[email protected]>
AuthorDate: Tue Jul 5 12:05:15 2022 +0200

    [SYSTEMDS-3394] Log4j incompatible dependencies
    
    Using `mvn dependency:tree` i cleaned up the log4j and slf4j dependencies.
    By removing their dependencies in spark, netty, and hadoop, and adding our 
own.
    
    Closes #1652
---
 pom.xml              | 189 ++++++++++++++++++++++++++++++++++++++++++++-------
 src/assembly/bin.xml |   8 +--
 2 files changed, 169 insertions(+), 28 deletions(-)

diff --git a/pom.xml b/pom.xml
index 406272bdb0..6268be7b34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,6 +50,8 @@
                <enableGPU>false</enableGPU>
                <jcuda.scope>provided</jcuda.scope>
                <jcuda.version>10.2.0</jcuda.version>
+               <slf4j.version>1.7.36</slf4j.version>
+               <log4j.version>2.17.2</log4j.version>
                <!-- Set java compile level via argument, ex: 1.8 1.9 10 11-->
                <java.level>11</java.level>
                <!-->Testing settings<!-->
@@ -77,8 +79,8 @@
 
        <scm>
                
<developerConnection>scm:git:https://github.com/apache/systemds.git</developerConnection>
-         <tag>HEAD</tag>
-  </scm>
+               <tag>HEAD</tag>
+       </scm>
 
        <build>
                <!-- Adds scripts to main jar, in-memory jar, sources jar, and 
standalone jar -->
@@ -201,8 +203,7 @@
                                                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                                                        
<mainClass>org.apache.sysds.api.DMLScript</mainClass>
                                                                </transformer>
-                                                               <transformer 
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
-                                                               </transformer>
+                                                               <transformer 
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"></transformer>
                                                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                                                        
<resource>META-INF/LICENSE</resource>
                                                                        
<file>src/assembly/bin/LICENSE</file>
@@ -240,7 +241,7 @@
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
-                               <version>3.8.1</version><!--$NO-MVN-MAN-VER$-->
+                               <version>3.8.1</version> <!--$NO-MVN-MAN-VER$-->
                                <configuration>
                                        <source>${java.level}</source>
                                        <target>${java.level}</target>
@@ -291,7 +292,8 @@
                                </executions>
                        </plugin>
 
-                       <plugin> <!-- unit tests -->
+                       <plugin>
+                               <!-- unit tests -->
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <version>3.0.0-M5</version>
@@ -514,8 +516,7 @@
                                                                                
                </goals>
                                                                                
        </pluginExecutionFilter>
                                                                                
        <action>
-                                                                               
                <ignore>
-                                                                               
                </ignore>
+                                                                               
                <ignore></ignore>
                                                                                
        </action>
                                                                                
</pluginExecution>
                                                                                
<pluginExecution>
@@ -528,8 +529,7 @@
                                                                                
                </goals>
                                                                                
        </pluginExecutionFilter>
                                                                                
        <action>
-                                                                               
                <ignore>
-                                                                               
                </ignore>
+                                                                               
                <ignore></ignore>
                                                                                
        </action>
                                                                                
</pluginExecution>
                                                                                
<pluginExecution>
@@ -542,8 +542,7 @@
                                                                                
                </goals>
                                                                                
        </pluginExecutionFilter>
                                                                                
        <action>
-                                                                               
                <ignore>
-                                                                               
                </ignore>
+                                                                               
                <ignore></ignore>
                                                                                
        </action>
                                                                                
</pluginExecution>
                                                                        
</pluginExecutions>
@@ -647,7 +646,7 @@
                                </plugins>
                        </build>
                </profile>
-               
+
                <profile>
                        <id>proton</id>
                        <build>
@@ -831,10 +830,10 @@
                        <exclusions>
                                <exclusion>
                                        <!-- always exclude recursive fetching 
of native libraries -->
-                                       <groupId>org.jcuda</groupId>
+                                       <groupId>org.jcuda</groupId>
                                        <artifactId>jcuda-natives</artifactId>
                                </exclusion>
-                       </exclusions>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -845,10 +844,10 @@
                        <exclusions>
                                <exclusion>
                                        <!-- always exclude recursive fetching 
of native libraries -->
-                                       <groupId>org.jcuda</groupId>
+                                       <groupId>org.jcuda</groupId>
                                        <artifactId>jcublas-natives</artifactId>
                                </exclusion>
-                       </exclusions>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -859,10 +858,10 @@
                        <exclusions>
                                <exclusion>
                                        <!-- always exclude recursive fetching 
of native libraries -->
-                                       <groupId>org.jcuda</groupId>
+                                       <groupId>org.jcuda</groupId>
                                        
<artifactId>jcusparse-natives</artifactId>
                                </exclusion>
-                       </exclusions>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -873,10 +872,10 @@
                        <exclusions>
                                <exclusion>
                                        <!-- always exclude recursive fetching 
of native libraries -->
-                                       <groupId>org.jcuda</groupId>
+                                       <groupId>org.jcuda</groupId>
                                        
<artifactId>jcusolver-natives</artifactId>
                                </exclusion>
-                       </exclusions>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -887,10 +886,10 @@
                        <exclusions>
                                <exclusion>
                                        <!-- always exclude recursive fetching 
of native libraries -->
-                                       <groupId>org.jcuda</groupId>
+                                       <groupId>org.jcuda</groupId>
                                        <artifactId>jcudnn-natives</artifactId>
                                </exclusion>
-                       </exclusions>
+                       </exclusions>
                </dependency>
 
                <!-- for all platforms, to be included in the extra jar -->
@@ -1018,18 +1017,84 @@
                        <groupId>org.apache.spark</groupId>
                        
<artifactId>spark-core_${scala.binary.version}</artifactId>
                        <version>${spark.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-api</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>jul-to-slf4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>jcl-over-slf4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.apache.hadoop</groupId>
+                                       
<artifactId>hadoop-client-api</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.apache.hadoop</groupId>
+                                       
<artifactId>hadoop-client-runtime</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.apache.hadoop</groupId>
+                                       
<artifactId>hadoop-client-runtime</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
                        <groupId>org.apache.spark</groupId>
                        
<artifactId>spark-sql_${scala.binary.version}</artifactId>
                        <version>${spark.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
                        <groupId>org.apache.spark</groupId>
                        
<artifactId>spark-mllib_${scala.binary.version}</artifactId>
                        <version>${spark.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -1041,6 +1106,14 @@
                                        <groupId>javax.servlet</groupId>
                                        <artifactId>servlet-api</artifactId>
                                </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-api</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
                        </exclusions>
                </dependency>
 
@@ -1053,6 +1126,14 @@
                                        <groupId>javax.servlet</groupId>
                                        <artifactId>servlet-api</artifactId>
                                </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
                        </exclusions>
                </dependency>
 
@@ -1060,12 +1141,36 @@
                        <groupId>org.apache.hadoop</groupId>
                        <artifactId>hadoop-client</artifactId>
                        <version>${hadoop.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>log4j</groupId>
+                                       <artifactId>log4j</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                        <version>1.1.3</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-log4j12</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.slf4j</groupId>
+                                       <artifactId>slf4j-reload4j</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -1147,6 +1252,16 @@
                        <artifactId>netty-all</artifactId>
                        <version>4.1.68.Final</version>
                        <scope>provided</scope>
+                       <exclusions>
+                               <exclusion>
+                                       
<groupId>org.apache.logging.log4j</groupId>
+                                       <artifactId>log4j-api</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       
<groupId>org.apache.logging.log4j</groupId>
+                                       <artifactId>log4j-1.2-api</artifactId>
+                               </exclusion>
+                       </exclusions>
                </dependency>
 
                <dependency>
@@ -1188,5 +1303,31 @@
                        <version>3.3.0</version>
                </dependency>
 
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>slf4j-api</artifactId>
+                       <version>${slf4j.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>jul-to-slf4j</artifactId>
+                       <version>${slf4j.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>jcl-over-slf4j</artifactId>
+                       <version>${slf4j.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>slf4j-reload4j</artifactId>
+                       <version>${slf4j.version}</version>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.apache.logging.log4j</groupId>
+                       <artifactId>log4j-api</artifactId>
+                       <version>${log4j.version}</version>
+               </dependency>
        </dependencies>
-</project>
+</project>
\ No newline at end of file
diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml
index fb5df47054..80a2ddd067 100644
--- a/src/assembly/bin.xml
+++ b/src/assembly/bin.xml
@@ -88,7 +88,6 @@
                                <include>*:commons-configuration*</include>
                                <include>*:commons-compress*</include>
                                <include>*:commons-compiler*</include>
-                               <!-- <include>*:commons-httpclient*</include> 
-->
                                <include>*:commons-io*</include>
                                <include>*:commons-lang</include>
                                <include>*:commons-lang3</include>
@@ -102,16 +101,17 @@
                                <include>*:hadoop-hdfs*</include>
                                <include>*:hadoop-mapreduce-client*</include>
                                <include>*:hadoop-yarn*</include>
-                               <include>*:jackson-core-asl*</include>
-                               <include>*:jackson-mapper-asl*</include>
+                               <include>*:hadoop-shaded-guava*</include>
+                               <include>*:jackson-core*</include>
+                               <include>*:jackson-mapper*</include>
                                <include>*:janino*</include>
                                <include>*:log4j*</include>
                                <include>*:netty*</include>
                                <include>*:protobuf-java*</include>
                                <include>*:py4j*</include>
                                <include>*:re2j*</include>
+                               <include>*:reload4j*</include>
                                <include>*:slf4j-api*</include>
-                               <include>*:slf4j-log4j*</include>
                                <include>*:spark-core*</include>
                                <include>*:stax2-api*</include>
                                <include>*:woodstox*</include>

Reply via email to