2017-06-07 54 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} 

可有人请张贴链接到这是记录? :)

相关问题