Skip to content

Instantly share code, notes, and snippets.

@ansrivas
Last active November 20, 2015 13:03
Show Gist options
  • Select an option

  • Save ansrivas/1fb6c1668a73cd4f353d to your computer and use it in GitHub Desktop.

Select an option

Save ansrivas/1fb6c1668a73cd4f353d to your computer and use it in GitHub Desktop.
Use this to create jars with and without dependencies , mvn clean compile package
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment