I'm trying to copy the .jar, created by Maven 3, to another location. Currently, I'm using Ant's copy task, but Maven simply doesn't copy the file.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<configuration>
<tasks>
<copy file="target/myfile.jar" tofile="D:/Bukkit/plugins/myfile.jar"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
You can use Maven's Dependency Plugin to save a copy of all the libraries and JAR files used by your project. In this article we'll look at how to use Maven to download all of your Java project's dependencies, like libraries and frameworks, and save them into a specific folder.
Using the Copy Rename Maven Plugin The copy-rename-maven-plugin helps copying files or renaming files/directories during the Maven build lifecycle. Upon building the project, we'll see foo. txt in the target/destination-folder.
Maven's local repository is a directory on the local machine that stores all the project artifacts. When we execute a Maven build, Maven automatically downloads all the dependency jars into the local repository. Usually, this directory is named . m2.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<tasks>
<copy file="target/myfile.jar" tofile="D:/Bukkit/plugins/myfile.jar"/>
</tasks>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With