Jboss Gradle的Cargo插件忽略已配置的端口

Jboss Gradle的Cargo插件忽略已配置的端口,jboss,gradle,cargo,Jboss,Gradle,Cargo,我有以下配置: cargo { containerId = deployContainerId port = jbossManagementPort deployable { file = tasks.getByPath(':frontend:war').archivePath context = 'xxxxxx' } remote { hostname = 'localhost' use

我有以下配置:

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

但两者都没有任何效果


如何告诉Cargo使用不同于默认端口的端口?

解决方案是对Cargo属性使用-D,而不是-p:

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

您可以在gradle构建中定义一个可能的解决方案来处理此问题

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