From 9e67637c69e6dbd7555b3145c9b15ea7bddde6e1 Mon Sep 17 00:00:00 2001 From: Octavia Togami <octavia.togami@gmail.com> Date: Sun, 11 Apr 2021 10:07:39 -0700 Subject: [PATCH] Update log4j to 2.11.2 for JDK 9+ compat (#5400) --- ...n-prefixes-using-Log4J-configuration.patch | 2 +- .../Include-Log4J2-SLF4J-implementation.patch | 3 +- Spigot-Server-Patches/POM-Changes.patch | 55 ++++++++++++++++--- ...oleAppender-for-console-improvements.patch | 1 - .../Use-asynchronous-Log4j-2-loggers.patch | 4 +- 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch b/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch index 41fe221c19..67a82a57ab 100644 --- a/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -19,9 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ + <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.8.1</version> - <scope>runtime</scope> + <scope>compile</scope> </dependency> diff --git a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch index 3c6d659fda..249db17915 100644 --- a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch +++ b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch @@ -9,13 +9,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ - <version>2.8.1</version> + <artifactId>log4j-api</artifactId> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> -+ <version>2.8.1</version> + <scope>runtime</scope> + </dependency> <dependency> diff --git a/Spigot-Server-Patches/POM-Changes.patch b/Spigot-Server-Patches/POM-Changes.patch index 8c8b07895c..13c4147711 100644 --- a/Spigot-Server-Patches/POM-Changes.patch +++ b/Spigot-Server-Patches/POM-Changes.patch @@ -40,6 +40,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 <relativePath>../pom.xml</relativePath> </parent> ++ <dependencyManagement> ++ <dependencies> ++ <dependency> ++ <groupId>org.apache.logging.log4j</groupId> ++ <artifactId>log4j-bom</artifactId> ++ <version>2.11.2</version> ++ <type>pom</type> ++ <scope>import</scope> ++ </dependency> ++ </dependencies> ++ </dependencyManagement> ++ <dependencies> <dependency> - <groupId>org.spigotmc</groupId> @@ -61,6 +73,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 <artifactId>minecraft-server</artifactId> <version>${minecraft.version}-SNAPSHOT</version> <scope>compile</scope> +@@ -0,0 +0,0 @@ + <version>2.12.1</version> + <scope>compile</scope> + </dependency> ++ <dependency> ++ <groupId>org.apache.logging.log4j</groupId> ++ <artifactId>log4j-api</artifactId> ++ <scope>compile</scope> ++ </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-iostreams</artifactId> +- <version>2.8.1</version> + <scope>compile</scope> +- <exclusions> +- <!-- included in minecraft-server --> +- <exclusion> +- <groupId>org.apache.logging.log4j</groupId> +- <artifactId>log4j-api</artifactId> +- </exclusion> +- </exclusions> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> @@ -0,0 +0,0 @@ <version>9.1</version> <scope>compile</scope> @@ -106,7 +142,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - <descriptionProperty>spigot.desc</descriptionProperty> - </configuration> - <phase>initialize</phase> -- <goals> ++ <phase>compile</phase> + <goals> - <goal>describe</goal> - </goals> - </execution> @@ -118,8 +155,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - <descriptionProperty>craftbukkit.desc</descriptionProperty> - </configuration> - <phase>initialize</phase> -+ <phase>compile</phase> - <goals> +- <goals> - <goal>describe</goal> + <goal>gitdescribe</goal> </goals> @@ -145,6 +181,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 <Specification-Title>Bukkit</Specification-Title> <Specification-Version>${api.version}</Specification-Version> <Specification-Vendor>Bukkit Team</Specification-Vendor> ++ <Multi-Release>true</Multi-Release> + </manifestEntries> + <manifestSections> + <manifestSection> @@ -0,0 +0,0 @@ <goal>shade</goal> </goals> @@ -162,11 +202,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + <!-- paper --> + <exclude>io/netty/**</exclude> + <exclude>META-INF/native/libnetty*</exclude> -+ <exclude>com/brigadier/**</exclude> ++ <exclude>com/mojang/brigadier/**</exclude> + <exclude>META-INF/MANIFEST.MF</exclude> -+ <exclude>com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository</exclude> -+ <exclude>com.mojang.datafixers.util.Either</exclude> -+ <exclude>org.apache.logging.log4j/**</exclude> ++ <exclude>com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.class</exclude> ++ <exclude>com/mojang/datafixers/util/Either*</exclude> ++ <exclude>org/apache/logging/log4j/**</exclude> ++ <exclude>META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat</exclude> </excludes> </filter> </filters> diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index 18359bf41d..3b8e01fc1d 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -49,7 +49,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> -+ <version>2.8.1</version> + <scope>runtime</scope> </dependency> <dependency> diff --git a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch index 44aab741ce..56d85b045d 100644 --- a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch @@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ - </exclusion> - </exclusions> + <artifactId>log4j-iostreams</artifactId> + <scope>compile</scope> </dependency> + <!-- Paper - Async loggers --> + <dependency>