环境
发行商ID: Ubuntu
描述: Ubuntu 16.04.5 LTS
释放: 16.04
代号:异种
Bug
我使用的是模版1.3.1.Final。(我知道很老.)
我试图覆盖apiman-default-config.json文件的网关属性:
"Gateways" : [ {
"id" : "TheGateway",
"name" : "The Gateway",
"description" : "This is the gateway.",
"createdBy" : "admin",
"createdOn" : "2016-05-16T12:34:15Z",
"modifiedBy" : "admin",
"modifiedOn" : "2016-05-16T12:34:15Z",
"type" : "REST",
"configuration" : "{\"endpoint\":\"${apiman.gateway-endpoint:https://localhost:8443/apiman-gateway-api}\",\"username\":\"${apiman.gateway-endpoint.username:apimanager}\",\"password\":\"${apiman.gateway-endpoint.password:apiman123!}\"}" } ]因此,我的想法是可以从apiman.properties配置文件覆盖这些属性。但是,例如,似乎在任何情况下都不会计算属性${apiman.gateway-endpoint.username}并使用默认值'apimanager‘。
现在,我的问题是如何重写以下属性?:
apiman.gateway-endpoint
apiman.gateway-endpoint.username
apiman.gateway-endpoint.password如果它是一个bug,它在以后的Apiman版本中修复了吗?
我可以覆盖整个文件,但如果我能避免,那就太好了.
问候
发布于 2018-11-27 16:07:31
在深入研究Apiman代码之后,我刚刚发现这些变量被System.env属性替换了。为了覆盖它们,可以将这些行添加到用于运行apiman的独立-apiman.xml配置中:
<system-properties>
<property name="apiman.gateway-endpoint" value="http://apiman.gateway.com"/>
<property name="apiman.gateway-endpoint.username" value="username"/>
<property name="apiman.gateway-endpoint.password" value="password"/>
</system-properties>https://stackoverflow.com/questions/53378597
复制相似问题