日期:2014-05-19  浏览次数:20792 次

maven 编译同时复制指定文件以及文件夹
现有项目test,我想在maven编译时同时拷贝另一文件到编译母目录,比如在执行mavn clean compile 时,把c盘下的abc.xml拷贝到编译目录target下,同时把c盘下的abc文件夹下所有内容拷贝到项目指定文件夹下,比如target下的abc文件夹,请问怎么做?
我试着在pom.xml中添加
XML code
<plugin>
                                <artifactId>maven-antrun-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <id>gen-webadmin</id>
                                                <phase>compile</phase>
                                                <configuration>
                                                        <tasks>
                                                                <copy todir="${basedir}/target/build/plugin_update/plugin"
                                                                        file="${basedir}/plugin.xml" />                                     
                                                        </tasks>
                                                </configuration>
                                                <goals>
                                                        <goal>run</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>

可以复制本项目中的plugin.xml到指定目录下,可是我要复制文件夹到指定目录就不好用了,请问怎么解决~

------解决方案--------------------
没用过maven,都是用ant,帮你顶下吧。