Prevent rogue slf4j-impl coming from wildfly-elytron-2.2.2.Final.jar

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2024-01-03 08:06:54 -06:00
parent a84818d398
commit ee0e1d47fe
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
4 changed files with 21 additions and 2 deletions

View File

@ -61,6 +61,9 @@ public class StacklessLogging implements AutoCloseable
public StacklessLogging(Class<?>... classesToSquelch)
{
if (loggerFactory == null)
return;
for (Class<?> clazz : classesToSquelch)
{
JettyLogger jettyLogger = loggerFactory.getJettyLogger(clazz.getName());
@ -77,6 +80,9 @@ public class StacklessLogging implements AutoCloseable
public StacklessLogging(Package... packagesToSquelch)
{
if (loggerFactory == null)
return;
for (Package pkg : packagesToSquelch)
{
JettyLogger jettyLogger = loggerFactory.getJettyLogger(pkg.getName());
@ -93,6 +99,9 @@ public class StacklessLogging implements AutoCloseable
public StacklessLogging(Logger... logs)
{
if (loggerFactory == null)
return;
for (Logger log : logs)
{
if (log instanceof JettyLogger && !log.isDebugEnabled())

View File

@ -340,7 +340,7 @@
<plexus-xml.version>4.0.3</plexus-xml.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<settingsPath>src/it/settings.xml</settingsPath>
<slf4j.version>2.0.5</slf4j.version>
<slf4j.version>2.0.9</slf4j.version>
<spotbugs.maven.plugin.version>4.8.2.0</spotbugs.maven.plugin.version>
<springboot.version>2.1.1.RELEASE</springboot.version>
<surefire.rerunFailingTestsCount>0</surefire.rerunFailingTestsCount>

View File

@ -33,6 +33,15 @@
<artifactId>jetty-home</artifactId>
<version>${project.version}</version>
<type>pom</type>
<exclusions>
<!-- Introduces test scope dependencies that shouldn't be present during testing.
Such as: older slf4j-api classes,
or a slf4j-impl (in wildfly-elytron-2.2.2.Final.jar!/org/slf4j/ILoggerFactory.class) -->
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>infinispan-remote-query</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>

View File

@ -47,6 +47,7 @@ import org.eclipse.jetty.toolchain.test.IO;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension;
import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.eclipse.jetty.webapp.Configuration;
@ -126,7 +127,7 @@ public class DeploymentErrorTest
{
if (stacklessLogging != null)
stacklessLogging.close();
server.stop();
LifeCycle.stop(server);
}
private void copyBadApp(String sourceXml, Path docroots)