带你了解Java Maven的打包操作
<profiles>
<profile>
<id>dev</id>
<properties>
<env>dev</env>
</properties>
<!--未指定环境时,默认打包dev环境-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<env>test</env>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<env>product</env>
</properties>
</profile>
</profiles>
<!--对于项目资源文件的配置放在build中-->
<resources>
<resource>
<directory>src/main/resources/${env}</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.tld</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
总结
本篇文章就到这里了,希望能够给你带来帮助,也希望您能够多多关注的更多内容!
以上是 带你了解Java Maven的打包操作 的全部内容, 来源链接: utcz.com/p/248857.html