Maven's assembly plugin enables the creation of a big jar including all dependencies with descriptorRef jar-with-dependencies
.
How can one exclude some of these dependencies? It seems like it does not have such a configuration? Is there another solution?
This example indicates one way to do this:
Essentially we would use the
excludes
option available independencySet
.See also: https://maven.apache.org/plugins/maven-assembly-plugin/assembly-component.html
You should use the
excludes
option available independencySet
.Follow below.:
Example in your pom.xml:
Now in your new file jar-with-deps-with-exclude.xml (where dependencySet live):
That's all.
Add the
<scope>provided</scope>
to the dependencies you don't want included in the jar-with-dependencies, e.g.