Ant*_*nio 7 resources maven-2 copy target
我正在学习如何使用maven作为我的独立java应用程序,但我不明白如何从/ src/main/resources到/ taget目录的所有目录的递归副本.
我尝试使用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>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助.
编辑:我会复制到/目标目录,如"bin","logs","conf",所以我可以测试该应用程序.并且,使用另一个maven任务,将所有内容(jar和bin/conf/tmp dirs)打包到zip/tar.gz文件中.
<plugins ... />代替<pluginManagement ... />。