| Refresh | Home EGTry.com

copy all dependency jar files to target/dependency directory


pom.xml example

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.egtry</groupId>
    <version>1</version>
    <artifactId>dependency_copy</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
          <version>8.1.0.v20120127</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                          <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>



build and copy command

mvn package


dependency jar copied to target\dependency directory

jetty-continuation-8.1.0.v20120127.jar
jetty-http-8.1.0.v20120127.jar
jetty-io-8.1.0.v20120127.jar
jetty-security-8.1.0.v20120127.jar
jetty-server-8.1.0.v20120127.jar
jetty-servlet-8.1.0.v20120127.jar
jetty-util-8.1.0.v20120127.jar
servlet-api-3.0.20100224.jar