Ingwersaft / wildfly-deploy-gradle-plugin

Gradle Plugin for deploying Files to Wildfly
https://plugins.gradle.org/plugin/com.mkring.wildlydeplyplugin.deploy-wildfly-plugin
GNU General Public License v3.0
10 stars 11 forks source link

Could a timeout parameter for connection be added? #24

Open Kosonome opened 3 years ago

Kosonome commented 3 years ago

I am encountering problems when I am trying to use this plugin to connect to a Docker with Wildfly 11, but it is not necessarily a bug in this plugin.

When I'm trying to run: ./bin/jboss-cli.bat -c --controller=localhost:9990 -u=admin -p=admin --timeout=5000

It returns the following error message: Failed to connect to the controller: The controller is not available at localhost:9990: java.net.ConnectException: WFLYPRT0023: Could not connect to remote + http://localhost:9990. The connection was in range: WFLYPRT0023: Could not connect to remote + http://localhost:9990. The connection has timed out

However, when running with a longer timeout, I can connect without problems: ./bin/jboss-cli.bat -c --controller=localhost:9990 -u=admin -p=admin --timeout=20000

There is something strange between my Docker and jboss-cli.bat, which also happens with this plugin when I try to gradle deploy task, however in this plugin it is not possible to specify any timeout at all, and maybe 5 seconds is a bit low?

As this parameter already exists in jboss-cli.bat, would it be possible to add a timeout parameter to this plugin?

I'm using version 0.2.12 and below is part of my project build.gradle, with an intended timeout.

task deploy(type: DeployWildflyTask) {
    host = 'localhost'
    port = 9990
    user = "admin"
    password = "admin"
    timeout = 30000
    deploymentName = "${project.name}-${project.version}"
    runtimeName = "${project.name}-${project.version}.ear"
    file = "$buildDir/libs/${project.name}-${project.version}.ear"
    dependsOn build
}
task executeCommands(type: ExecuteWildflyTask) {
    host = "localhost"
    port = 9990
    user = "admin"
    timeout = 30000
    password = "admin"
    commands = file('docker/config.cli').readLines().findAll{ !it.isEmpty() }.collect()
}
Ingwersaft commented 3 years ago

An optional timeout setting sounds reasonable, sure :)

I have not been working with jEE since 2018 already, but PRs are welcome :+1: