1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Description: Upgrade to SLF4J 1.7.25 and remove the monkey patching
Author: Emmanuel Bourg <ebourg@apache.org>
Bug: https://github.com/apache/maven/pull/118
--- a/maven-slf4j-provider/pom.xml
+++ b/maven-slf4j-provider/pom.xml
@@ -42,6 +42,11 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4jVersion}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</dependency>
@@ -49,48 +54,31 @@
<build>
<plugins>
+ <!-- Shade slf4j-simple without StaticLoggerBinder to ensure SLF4J picks our implementation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>${slf4jVersion}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${project.build.directory}/generated-sources/slf4j-simple</outputDirectory>
- <includes>org/slf4j/impl/*.java</includes>
- <excludes>org/slf4j/impl/StaticLoggerBinder*</excludes>
- </artifactItem>
- </artifactItems>
- </configuration>
- <executions>
- <execution>
- <id>unzip-slf4j-simple</id>
- <goals>
- <goal>unpack</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.12</version>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.0.0</version>
<executions>
<execution>
- <id>add-slf4j-simple</id>
- <phase>generate-sources</phase>
+ <phase>package</phase>
<goals>
- <goal>add-source</goal>
+ <goal>shade</goal>
</goals>
<configuration>
- <sources>
- <source>${project.build.directory}/generated-sources/slf4j-simple</source>
- </sources>
+ <artifactSet>
+ <includes>
+ <include>org.slf4j:slf4j-simple</include>
+ </includes>
+ </artifactSet>
+ <filters>
+ <filter>
+ <artifact>org.slf4j:slf4j-simple</artifact>
+ <excludes>
+ <exclude>org/slf4j/impl/StaticLoggerBinder*</exclude>
+ </excludes>
+ </filter>
+ </filters>
</configuration>
</execution>
</executions>
|