2014-10-09 87 views
1

我具有以下配置:爲搖籃貨物插件忽略配置的端口

cargo { 
    containerId = deployContainerId 
    port = jbossManagementPort 

    deployable { 
     file = tasks.getByPath(':frontend:war').archivePath 
     context = 'xxxxxx' 
    } 

    remote { 
     hostname = 'localhost' 
     username = 'xxxxxxx' 
     password = 'xxxxxxx' 
    } 

    local { 
     homeDir = file(jbossHome) 
     timeout = 60000 
    } 
} 

當我調用搖籃

gradle -PjbossManagementPort=12345 -PdeployContainerId=jboss7x -PjbossHome=/opt/jboss cargoRedeployRemote 

配置的端口將被忽略。它仍然會嘗試連接到9999我已經嘗試了變種,如

gradle -Pcargo.port=12345 -PdeployContainerId=jboss7x -PjbossHome=/opt/jboss cargoRedeployRemote 

而且

gradle -Pcargo.jboss.management-native.port=12345 -PdeployContainerId=jboss7x -PjbossHome=/opt/jboss cargoRedeployRemote 

但是,無論有任何影響。

如何告訴Cargo使用與默認值不同的端口?

回答

0

的解決方案是使用-D的貨物屬性,而不是-P:

gradle -Dcargo.jboss.management-native.port=12345 -PdeployContainerId=jboss7x -PjbossHome=/opt/jboss cargoRedeployRemote 
0

一個可能的解決方案,你可以在你的gradle這個構建定義來處理這個問題。

remote { 
      //You can define custom cargo properties here 
      containerProperties { 
       property 'cargo.jboss.management-native.port', 12345 
      } 
      hostname = 'localhost' 
      username = 'xxxxxxx' 
      password = 'xxxxxxx' 
     }