How to exclude dependencies from maven assembly plugin : jar-with-dependencies?

Jérôme Verstrynge picture Jérôme Verstrynge · Jun 2, 2011 · Viewed 35.6k times · Source

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?

Answer

Jeroen Vuurens picture Jeroen Vuurens · Mar 29, 2015

Add the <scope>provided</scope> to the dependencies you don't want included in the jar-with-dependencies, e.g.

    <dependency>
      <groupId>storm</groupId>
      <artifactId>storm</artifactId>
      <version>0.6.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>