2017-06-07 52 views
1

我使用JBoss EAP 7.0.5不工作,我想在我的獨立,ha.xml使用內部配置值,如:Wildfly CLI「決心參數值」如預期

<property name="javax.net.ssl.trustStore" value="${jboss.server.config.dir}/stores/trustCA.jks"/> 

/system-property=javax.net.ssl.trustStore:add(value="${jboss.server.config.dir}/stores/trustCA.jks") 

遺憾的是它並沒有去預期:使用廣泛Maven插件1.2.0阿爾法5和CLI命令添加了此值

<property name="javax.net.ssl.trustStore" value="/stores/trustCA.jks"/> 

JBoss的-cli.xml看起來是這樣的:

<?xml version='1.0' encoding='UTF-8'?> 

<!-- 
    WildFly Command-line Interface configuration. 
--> 
<jboss-cli xmlns="urn:jboss:cli:2.0"> 

    <default-protocol use-legacy-override="true">http-remoting</default-protocol> 

    <!-- The default controller to connect to when 'connect' command is executed w/o arguments --> 
    <default-controller> 
     <protocol>http-remoting</protocol> 
     <host>localhost</host> 
     <port>9990</port> 
    </default-controller> 

    <!-- Example controller alias named 'Test' 
    <controllers> 
     <controller name="Test"> 
      <protocol>http-remoting</protocol> 
      <host>localhost</host> 
      <port>9990</port> 
     </controller> 
    </controllers> 
    -->  

    <validate-operation-requests>true</validate-operation-requests> 

    <!-- Command and operation history log configuration --> 
    <history> 
     <enabled>true</enabled> 
     <file-name>.jboss-cli-history</file-name> 
     <file-dir>${user.home}</file-dir> 
     <max-size>500</max-size> 
    </history> 

    <!-- whether to resolve system properties specified as command argument or operation parameter values 
        in the CLI VM before sending the operation requests to the controller --> 
    <resolve-parameter-values>false</resolve-parameter-values> 


    <!-- Whether to write info and error messages to the terminal output --> 
    <silent>false</silent> 

    <!-- Whether to filter out commands and attributes based on user's permissions --> 
    <access-control>false</access-control> 
</jboss-cli> 

我也使用這樣的變量嘗試,它仍然得到解決:

${jboss.server.config.dir:} 

我只是用錯或可在此可能是CLI或maven插件錯誤?

回答

0

此行爲不是由蜻蜓本身引起的,但可能由Maven蜻蜓插件引起。此插件不會調用命令行本機管理界面,因此它將忽略<resolve-parameter-values>值。它使用jboss客戶端java api,它似乎執行表達式評估 - 請參閱CommandExecutor.java#executeCommands。如果你試圖通過jboss-cli.sh直接執行你的cli命令,它會像你期望的那樣工作,即變量不會被內插。

+0

你說得對。謝謝。 –

+0

它實際上是由Maven本身造成的。在POM中,Maven將嘗試解析'$ {jboss.server.config.dir}'。它應該在CLI腳本中工作,但是它看起來像1.2.0中引入了一個錯誤,https://issues.jboss.org/browse/WFMP-79。 –

+0

使用1.2.0 Alpha6進行檢查。現在它按預期工作! –

0

這工作:

$${jboss.server.config.dir} 

可有人請張貼鏈接到這是記錄? :)

相關問題