Skip to content

Instantly share code, notes, and snippets.

@petergdoyle
Last active February 5, 2016 18:27
Show Gist options
  • Save petergdoyle/90629a780af4c2f4b708 to your computer and use it in GitHub Desktop.
Save petergdoyle/90629a780af4c2f4b708 to your computer and use it in GitHub Desktop.
<profile>
<id>copy-dependencies</id>
<!--
Usage: mvn clean install -Pcopy-dependencies -Dpackage-name=om.manning.nettyinaction.chapter2 -Dclass-name=Ech
oServer
java -jar target/${artifactId}.jar
-->
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>${package-name}.${class-name}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment