上一章介绍使用ant拷贝资源,这里介绍maven拷贝资源,使用maven-resources-plugin插件。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-dbscript</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>../../target/dbscript</outputDirectory>
<resources>
<resource>
<directory>../../DM/dbscript/</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-releaseNotes</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>../../target/releaseNotes</outputDirectory>
<resources>
<resource>
<directory>../../DF/releaseNotes</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
本文介绍如何使用Maven的maven-resources-plugin插件来拷贝项目中的资源文件到指定目录,包括数据库脚本和发布说明等。
Maven拷贝资源&spm=1001.2101.3001.5002&articleId=84692946&d=1&t=3&u=f16d36dc67714525ac9fda0312b05f50)
7182

被折叠的 条评论
为什么被折叠?



