Last active
December 20, 2015 06:09
-
-
Save mguilherme/6083865 to your computer and use it in GitHub Desktop.
Jar with dependencies using maven-dependency-plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.your.company</groupId> | |
| <artifactId>test-artifact</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> | |
| <properties> | |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
| <java.version>1.7</java.version> | |
| <!-- Libraries --> | |
| <spring.version>3.2.3.RELEASE</spring.version> | |
| <rome.version>1.0.0</rome.version> | |
| <javax.mail.version>1.4.7</javax.mail.version> | |
| <commons.lang3.version>3.1</commons.lang3.version> | |
| <slf4j.version>1.7.5</slf4j.version> | |
| <logback.version>1.0.13</logback.version> | |
| <junit.version>4.11</junit.version> | |
| </properties> | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <artifactId>maven-compiler-plugin</artifactId> | |
| <configuration> | |
| <source>${java.version}</source> | |
| <target>${java.version}</target> | |
| </configuration> | |
| </plugin> | |
| <!-- Fun stuff Starts here :D --> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-jar-plugin</artifactId> | |
| <configuration> | |
| <archive> | |
| <manifest> | |
| <addClasspath>true</addClasspath> | |
| <mainClass>com.your.company.init.Start</mainClass> | |
| <classpathPrefix>dependencies/</classpathPrefix> | |
| </manifest> | |
| </archive> | |
| </configuration> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-dependency-plugin</artifactId> | |
| <version>2.5.1</version> | |
| <executions> | |
| <execution> | |
| <id>copy-dependencies</id> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>copy-dependencies</goal> | |
| </goals> | |
| <configuration> | |
| <outputDirectory>${project.build.directory}/dependencies/</outputDirectory> | |
| <overWriteReleases>false</overWriteReleases> | |
| <overWriteSnapshots>false</overWriteSnapshots> | |
| <overWriteIfNewer>true</overWriteIfNewer> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| </plugins> | |
| </build> | |
| <dependencies> | |
| <!-- Spring --> | |
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-core</artifactId> | |
| <version>${spring.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-context</artifactId> | |
| <version>${spring.version}</version> | |
| <!-- We want to use SLF4J since commons-logging is problematic --> | |
| <exclusions> | |
| <exclusion> | |
| <groupId>commons-logging</groupId> | |
| <artifactId>commons-logging</artifactId> | |
| </exclusion> | |
| </exclusions> | |
| </dependency> | |
| <!-- Mail Support --> | |
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-context-support</artifactId> | |
| <version>${spring.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-test</artifactId> | |
| <version>${spring.version}</version> | |
| <scope>test</scope> | |
| </dependency> | |
| <!-- RSS --> | |
| <dependency> | |
| <groupId>net.java.dev.rome</groupId> | |
| <artifactId>rome</artifactId> | |
| <version>${rome.version}</version> | |
| </dependency> | |
| <!-- Mail --> | |
| <dependency> | |
| <groupId>javax.mail</groupId> | |
| <artifactId>mail</artifactId> | |
| <version>${javax.mail.version}</version> | |
| </dependency> | |
| <!-- Misc Dependencies --> | |
| <dependency> | |
| <groupId>org.apache.commons</groupId> | |
| <artifactId>commons-lang3</artifactId> | |
| <version>${commons.lang3.version}</version> | |
| </dependency> | |
| <!-- Logging --> | |
| <dependency> | |
| <groupId>ch.qos.logback</groupId> | |
| <artifactId>logback-classic</artifactId> | |
| <version>${logback.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.slf4j</groupId> | |
| <artifactId>log4j-over-slf4j</artifactId> | |
| <version>${slf4j.version}</version> | |
| </dependency> | |
| <!-- Test --> | |
| <dependency> | |
| <groupId>junit</groupId> | |
| <artifactId>junit</artifactId> | |
| <version>${junit.version}</version> | |
| <scope>test</scope> | |
| </dependency> | |
| </dependencies> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment