papegaaij commented on code in PR #1692:
URL: https://github.com/apache/wicket/pull/1692#discussion_r4527087529
##########
archetypes/quickstart/src/main/resources/archetype-resources/pom.xml:
##########
@@ -182,6 +184,7 @@
<systemProperties>
<maven.project.build.directory.test-classes>${project.build.directory}/test-classes</maven.project.build.directory.test-classes>
</systemProperties>
+ <useTestScope>true</useTestScope>
Review Comment:
`useTestScope` brings the logging back, but it puts the whole test classpath
into the webapp: Jetty itself, `jakarta.servlet-api`, JUnit, wicket-tester and
`target/test-classes`. On a generated quickstart, every `mvn jetty:run` now
prints 84 "scanned from multiple locations" warnings, one per servlet API
class, because that API is now in both the container and the webapp. That's the
first thing someone new to Wicket sees.
Keeping `slf4j-simple` at compile scope and leaving it out of the WAR avoids
this:
```xml
<plugin>
<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>
```
I tried it on quickstarts generated from this branch, with Wicket
12.0.0-SNAPSHOT on ee11 and 10.12.0 on ee10. `jetty:run` logs, the home page
renders, there are no warnings, and `WEB-INF/lib` contains `slf4j-api` but no
`slf4j-simple`: the same WAR this PR produces. The comment above the dependency
would then explain the exclusion rather than the scope. On 10.x this also means
the dependency doesn't need to change scope at all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]