Sometimes you need to download jars, which were in your "dependencies" block into specified directory.
For this task you may use this approach: in "plugins" part of your pom.xml add such block:
For this task you may use this approach: in "plugins" part of your pom.xml add such block:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
This will copy all jars into target/lib folder after run command : mvn generate-sources
If you want to specify directory from command line, you can do such thing: