简体   繁体   English

Jenkins在建造时没有将“Properties”传递给maven

[英]Jenkins not passing “Properties” to maven while building

在此输入图像描述

I configured Jenkins to build a maven project. 我配置Jenkins来构建一个maven项目。 While building, I pass the Properties in the "Properties" section as mentioned in the image. 在构建时,我在图像中提到的“属性”部分中传递属性。 when I trigger the build, I would see: mvn -f test/pom.xml -Dname1=value1 -Dname2=value2 clean test 当我触发构建时,我会看到: mvn -f test/pom.xml -Dname1=value1 -Dname2=value2 clean test

This above setup was working perfectly. 上面的设置工作得很好。

However, all of a sudden the setup stopped working. 然而,突然之间设置停止了工作。 The way maven is building currently is: mvn -f test/pom.xml clean test maven目前正在构建的方式是: mvn -f test/pom.xml clean test

I noticed that properties were not passed to maven 我注意到属性没有传递给maven

The only thing that I did was installing "Job Configuration History" and "Configuration Slicing" plugins. 我唯一做的就是安装“作业配置历史”和“配置切片”插件。 I tried editing "Maven Top Level Targets" inside "Configuration Slicing" and that perhaps disrupted things. 我尝试在“配置切片”中编辑“Maven顶级目标”,这可能会破坏事物。 I uninstalled both "Job Configuration History" and "Configuration Slicing" plugins. 我卸载了“作业配置历史记录”和“配置切片”插件。 But I still see the problem 但我仍然看到了问题

This is resolved. 这已经解决了。 I had to enable the "Inject build variables" under "Invoke top-level Maven targets" 我必须在“调用顶级Maven目标”下启用“注入构建变量”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM