今天在工作时遇到一个测试环境maven打包失败的问题。一开始的时候jenkins只显示了打包失败,没有其他的信息展示出来,在将项目拉取到本地之后,项目又可以完好地启动,于是判断可能是maven打包时出错,于是终端进入对应目录之后,输入以下命令:
mvn package -U -Denv=pre -DskipTests
果然,build failed。
现场失败信息如下:
于是Google了一下这个
maven-resource-plugin
官网对它的介绍是:
The Resources Plugin handles the copying of project resources to the output directory. There are two different kinds of resources: main resources and test resources. The difference is that the main resources are the resources associated to the main source code while the test resources are associated to the test source code.
查看了官方的介绍之后,我对它的总结如下:
我们可以使用maven-resource-plugin在构建项目时对pom文件进行动态的变量替换,比如:</