简体   繁体   English

Jenkins中的环境变量在Java Maven Project中带有点

[英]Environment variable in Jenkins with dot in Java Maven Project

I have a Java program(Maven build) and which is using environment variable with dot(.) as mentioned below for Cloud Foundry, and my application has unit test that connect to vault/database while building artifact in Jenkins server 我有一个Java程序(Maven构建),并且正在对Cloud Foundry使用下面提到的点(。)使用环境变量,并且我的应用程序具有在Jenkins服务器中构建工件时连接到Vault /数据库的单元测试。

vcap.services.dor.credentials.path vcap.services.dor.credentials.path

is there a way I can set these variable in Jenkins and get access in my java code while unit test? 有没有一种方法可以在Jenkins中设置这些变量,并在进行单元测试时在Java代码中进行访问?

Try something like this, using the "Invoke top-level Maven targets": 使用“调用顶级Maven目标”来尝试类似的事情:

在此处输入图片说明

$MY_VARIABLE comes from an input from your build. $ MY_VARIABLE来自构建的输入。 Like this: 像这样:

在此处输入图片说明

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

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