Don’t Build the Maven Jar

I’m using the maven-assembly-plugin to build a zip for some static content in a maven module. But when I build the whole project I also end up getting a jar file for that module. To avoid this use one of two tricks –  either specify your build as a type “pom” or  tell the jar plugin to do nothing at all.

1.  POM type packaging

<groupId>"group ID"</groupId>
<artifactId>"artifact ID"</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

2.  “Nulling” the jar plugin

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
<configuration>
<finalName>nothing</finalName>
<classifier>nothing</classifier>
</configuration>
</execution>
</executions>
</plugin>

Comments are closed.