-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jetty-maven-plugin logging "scanned from multiple locations" on conflicts between .m2 and WEB-INF directories #6113
Comments
Did you do anything to alter (or customize) the default server / container / webapp / webinf jar pattern configurations? |
Do you mean e.g. If that's what you mean, no, we didn't include these in the pom.xml when this behavior was occurring. Ultimately our solution to remove these warnings was to disable annotation scanning by using an exclusive regex for the above jar pattern tags. We only use web.xml rather than annotations for our project, so this was acceptable. I'd be happy to try and help if this seems like unexpected behavior or something that needs additional configuration, though. |
@wcedmisten you can also disable annotation scanning by simply making your web.xml metadatacomplete=true. If you use jsps in your project, you will need to keep annotation support in there. I'm still not clear how you have a multiple copies on the classpath. The jetty-maven-plugin synthesizes the equivalent of WEB-INF/lib by using the maven depenencies for the project. Do you have some jars physcially in your WEB-INF/lib as well as dependencies in the pom? Can you post a sanitized pom.xml? |
I think I figured out what was happening here. For our test process, we build the webapp in one maven command, and then run the jetty maven plugin in another. Apparently, the first step involves copying the webapp files into another directory (I think to integrate them with the frontend code), which is where the duplication was coming from. My solution was to set |
@wcedmisten I think your test process sounds like it needs to be streamlined ;)
|
Gotcha, thanks for the information! I'll try to clean up our process. |
Jetty version 9.4.38.v20210224
Java version Scala 2.11.7
Question How to resolve duplicate class scans between .m2 and WEB-INF jars.
When I run
mvn jetty:run
, I get copious warnings about classes "scanned from multiple locations". The first location being in my .m2 cache directory and the second being my WEB-INF directory for the webapp I'm trying to test. I believe the WEB-INF jars should be scanned over the .m2 jars, and I was wondering how to configure that behavior.I found a stackoverflow post which solves a similar issue by excluding the WEB-INF files from being scanned, but that seems backwards to me. Please let me know if I'm missing anything, any help would be appreciated. Thanks!
Partially related to #3190
The text was updated successfully, but these errors were encountered: