Maven dependencies which are provided by your target container should be listed as scope
provided
. As per official documentation
This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.
Hence, you should set the concerned dependencies as scope provided:
<dependency>
<groupId>...</groupId>
<artifactId>..</artifactId>
<version>...</version>
<scope>provided</scope>
</dependency>
Maven will use it for compilation, testing but not for packaging. And it will also be excluded from Manifest classpath.
You can check this SO question about difference between provided
and compile
scope (the default one, no need to specify it at each dependency declaraction) while this SO question had exactly the opposite issue.