I am trying to use the Maven assembly plugin to build a jar-with-dependencies, except those that have provided scope.
I have copied the jar-with-dependencies into an assembly.xml file and configured its use in my pom. Here it is for reference:
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>injectable-jar</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
</fileSet>
</fileSets>
</assembly>
I have found out, that if I set the scope to provided
, then I can build a jar that contains exactly what I don't want, but I cannot figure out how to get inverse behavior of that.