jbossgradlecargo

Cargo plugin for Gradle ignoring configured port


I have the following configuration :

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
    }
}

When I invoke Gradle with

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

The configured port is ignored. It still tries to connect to 9999. I have tried variants, such as

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

And

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

But neither has any effect.

How do I tell Cargo to use a different port than the default?


Solution

  • The solution is to use -D for the cargo-property rather than -P:

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