【发布时间】:2012-04-04 16:32:02
【问题描述】:
在构建期间,我需要将 5 个properties 文件从我的项目工作区src/main/resources/my 复制到文件夹C:\my(我在Windows 7 上开发)。 C:\my 存在但为空。
我在我的 pom.xml 文件中使用了以下代码,但文件没有被复制。
在构建过程中,我没有收到任何错误,但我得到以下输出:
[INFO] --- maven-resources-plugin:2.5:copy-resources (copy-my-resources) @ my-webapp ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 5 resources
注意,它不会像复制成功时通常那样显示[INFO] Copying 5 resources to somewhere。
但是,文件根本没有复制到C:\my。
你能看到我应该在我的 xml 代码中更改什么吗?
以下是相关代码:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-my-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!-- overwrite! -->
<overwrite>true</overwrite>
<outputDirectory>${env.HOMEDRIVE}/my</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/my</directory>
<filtering>false</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: maven maven-resources-plugin