Search code examples
mavenmaven-assembly-plugin

How can a build a jar with the maven assembly plugin that does not package any dependencies?


Maven assembly plugin has a predefined descriptor for jar-with-dependencies but not a jar-without-dependencies.

I know there is an exclusion config but wild cards do not seem to work with exclusions. Or I am not using them right.

<dependencySets>
    <dependencySet>
        <excludes>
            <exclude>*</exclude>
        </excludes>
    </dependencySet>
</dependencySets>

Solution

  • You do not need to use assembly plugin, your scenario may be covered by maven-war-plugin with attachedClasses parameter and a classifier, see FAQ on site: http://maven.apache.org/plugins/maven-war-plugin/faq.html#attached