Leave slf4j-simple out of the quickstart WAR instead of giving it test scope (#1691) GitHub issue #1690, a follow-up to GitHub issue #1678. #1684 gave slf4j-simple test scope so that a generated WAR carries no SLF4J back end, which clashes with containers that bring their own, such as WildFly. That also took the only back end away from mvn jetty:run: the Jetty Maven plugin leaves test-scoped dependencies off the webapp classpath, so a generated quickstart printed "No SLF4J providers were found" and dropped all of Wicket's logging, including the exceptions the request cycle logs. Wicket 11.0.0 shipped with this. Turning on the plugin's useTestScope would bring the logging back, but it puts the whole test classpath into the webapp, the servlet API included, and every jetty:run then prints 84 "scanned from multiple locations" warnings. slf4j-simple is back at compile scope, and the maven-war-plugin excludes it from the WAR. Start, jetty:run and the tests log through it, the WAR and the exploded webapp contain slf4j-api but no back end, and jetty:run prints no warnings. A WAR deployed to a container without an SLF4J back end of its own needs one added; the comment on the dependency says so. Generated-by: Claude Code (Claude Opus 5.5)
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml b/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml index eec1091..77ca7e9 100644 --- a/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
@@ -70,12 +70,13 @@ </dependency> --> - <!-- LOGGING DEPENDENCIES - SLF4J-SIMPLE --> + <!-- LOGGING DEPENDENCIES - SLF4J-SIMPLE, for Start, jetty:run and the tests. + The maven-war-plugin leaves it out of the WAR: a container without an SLF4J + back end of its own needs one added. --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>${slf4j.version}</version> - <scope>test</scope> </dependency> <!-- JUNIT DEPENDENCY FOR TESTING --> @@ -174,6 +175,9 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>@maven-war-plugin.version@</version> + <configuration> + <packagingExcludes>WEB-INF/lib/slf4j-simple-*.jar</packagingExcludes> + </configuration> </plugin> <plugin> <groupId>org.eclipse.jetty.ee11</groupId>