Gradle cargo plugin port server not reached

I’m getting this message:

14:23:42.135 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@26b625127 pairs: {POST /management/add-content HTTP/1.1: null}{Connection: close}{Content-Type: multipart/form-data; boundary=CargoBoundary}{User-Agent: Java/1.8.0_45}{Host: localhost:9990}{Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2}{Content-Length: 29831794}

Nevertheless, my task sets the port to connect to is 9992 instead of used 9990!
So, the connection is refused! How could I change the port?

def remoteContainers = [
	new RemoteContainer(
		name: 'wildfly10',
		container: 'wildfly10x',
		hostname: 'localhost',
		port: 9992,
		username: '----',
		password: '----',
        purpose: 'development'
	)
]

remoteContainers.each { config ->
	task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
		description = "Deploys WAR to remote Web Application Server: '${config.name}'."
		containerId = config.container
		hostname = config.hostname
		port = config.port
		username = config.username
		password = config.password
		context = "webapi"
		dependsOn = [createDevelopmentWar]
	}
}

I’ve just realized that I’m getting different messages when I’m using --debug and --info.

When I perform gradle deployDevWildfly10 --info I’m getting this message:

Deployable artifacts = [D:\projects\living\platform\commty\build\dists\commty-dev-de31042.war]
Starting action ‘deploy’ for remote container ‘wildfly10x’ on http://localhost:9992
Container properties = [:]
:deployDevWildfly10 FAILED

Otherwise, using gradle deployDevWildfly10 --debug I’m getting these messages:

08:30:20.505 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@5b565a527 pairs: {POST /management/add-content HTTP/1.1: null}{Connection: close}{Content-Type: multipart/form-data; boundary=CargoBoundary}{User-Agent: Java/1.8.0_45}{Host: localhost:9990}{Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2}{Content-Length: 29832076}
08:30:20.627 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@4a857f181 pairs: {Content-type: unknown/unknown}
08:30:20.627 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:deployDevWildfly10’
08:30:20.627 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :deployDevWildfly10 FAILED

This is my last gradle script.

Any ideas?

See discussion on https://github.com/bmuschko/gradle-cargo-plugin/issues/162.

Dear @bmuschko I’ve changed what you re commenting me:

remoteContainers.each { config ->
task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
	description = "Deploys WAR to remote Web Application Server: '${config.name}'."
	containerId = config.container
	hostname = config.hostname
	port = config.port
	username = config.username
	password = config.password
	context = "webapi"
	dependsOn = [createDevelopmentWar]
	deployables = [new com.bmuschko.gradle.cargo.convention.Deployable(file: createDevelopmentWar.archivePath)]
	containerProperties['cargo.jboss.management-http.port', 9992]
} 

Nevertheless, I seems cardo is trying to connect to 9990 instead of 9992.

Any ideas?