用maven复制jar文件
我正试图将Maven 3创建的.jar复制到另一个位置。 目前,我正在使用Ant的复制任务,但Maven根本不复制文件用maven复制jar文件,maven,ant,pom.xml,Maven,Ant,Pom.xml,我正试图将Maven 3创建的.jar复制到另一个位置。 目前,我正在使用Ant的复制任务,但Maven根本不复制文件 <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>install</phase> <configuration>
<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>
maven antrun插件
安装
maven antrun插件
安装
跑
问题是你为什么喜欢这样做?因为看起来你是在当前项目之外复制的,这不是Maven的意图。这看起来更像是部署工具的工作,而Maven不是。Ant任务是一种方法,但最好从maven外部解决。您建议使用什么工具来实现这一目的?
<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>