【发布时间】:2010-07-20 09:56:31
【问题描述】:
我正在学习如何将 maven 用于我的独立 Java 应用程序,但我不明白如何将所有目录从 /src/main/resources 递归复制到 /tget 目录。
我尝试使用 antrun 和资源插件,但资源被复制到 /target/classes 而不是 /target。
这里有什么问题?
<build>
<pluginManagement><plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>
<copy todir="${basedir}/target">
<fileset dir="${basedir}/src/main/resources" includes="**/*" />
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin> </pluginManagement>
</build>
感谢您的帮助。
编辑: 我会复制到 /target 目录,例如“bin”、“logs”、“conf”,这样我就可以测试应用程序了。并且,通过另一个 maven 任务,将所有内容(jar 和 bin/conf/tmp 目录)打包到一个 zip/tar.gz 文件中。
【问题讨论】:
标签: maven-2 resources copy target