Is it right, that in case of duplicate classes, the one in "classes" will be taken?
Consider in a web application the class A will be available directly in
WEB-INF/classes
and a part of a jar in
WEB-INF/lib
Will the one in classes always win?
This depends on the class path - the classpath entry that comes first will initially win. Also, if there are multiple class loaders, a class loader that has loaded the the dependent class will be tried first. It should not depend on if classes are in the jar or not. Documented here.
In general, do not do this as having multiple classes under same name is a true recipe for disaster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With