How to remove unwanted jars included in the lib using maven

Maven automatically resolves dependencies transitively, i.e. it adds the dependencies of your dependencies to the WAR as well.

This way Maven makes sure that you do not run into ClassNotFound exceptions because viewservlets is trying to call something that does not exist.

Of course, it may be the case that some of those dependencies are not really called at runtime. If you are sure that a given artifact is never called, you can exclude it with an exclusion. But it is generally hard to determine that and it is probably not worth the effort.

EDIT: an example


CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top