I am trying to get all the jar required for a maven project inside a particular folder.
I have used mvn dependency:copy-dependencies
command.
It giv
You need to use the outputDirectory property to define the required location where you would like the jars to be copied to.
Here is an example of the configuration you would add in your POM:
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
Alternatively you can pass this configuration directly via the command line:
mvn -DoutputDirectory=alternativeLocation dependency:copy-dependencies