bmuschko / gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Apache License 2.0
258 stars 61 forks source link

wildfly 9x issues #134

Closed hrstoyanov closed 9 years ago

hrstoyanov commented 9 years ago

I tried to update my stack to Wildfly9.0.1.Final, which has been out for some time now. Cargo 1.14.5 clearly supports it when one specifies container wildfly9x, but this plugin bombs. Can you please help...

Here is how I configured it:

apply plugin: 'com.bmuschko.cargo'

buildscript {
    ...
    dependencies {
        classpath 'com.bmuschko:gradle-cargo-plugin:2.1.1'
    }
}

cargo {
    containerId = 'wildfly9x'
    remote {
        hostname = 'localhost'
        username = 'admin'
        password = 'admin'
    }
    local {
      jvmArgs = '-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n'
      homeDir = file("${wildfly_root}")
    }
    deployable {
        file = tasks.draftWar.archivePath
        context = '/draft'
    }
}

dependencies {
...
    def cargoVersion = '1.4.15'
    cargo  "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",
           "org.codehaus.cargo:cargo-ant:$cargoVersion"

Here is what I got:

 ./gradlew -p s4g-web draftWar cargoRedeployRemote
Incremental java compilation is an incubating feature.
:s4g-common:compileJava UP-TO-DATE
:s4g-common:processResources UP-TO-DATE
:s4g-common:classes UP-TO-DATE
:s4g-common:jar UP-TO-DATE
:s4g-web:compileJava UP-TO-DATE
:s4g-web:processResources UP-TO-DATE
:s4g-web:classes UP-TO-DATE
:s4g-web:draftCompileGwt UP-TO-DATE
:s4g-web:draftWar UP-TO-DATE
:s4g-web:cargoRedeployRemote FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':s4g-web:cargoRedeployRemote'.
> Unsupported container ID 'wildfly9x'. Please pick a valid one: [geronimo1x, geronimo2x, geronimo3x, glassfish2x, glassfish3x, glassfish4x, jboss3x, jboss42x, jboss4x, jboss51x, jboss5x, jboss61x, jboss6x, jboss71x, jboss72x, jboss73x, jboss74x, jboss7x, jetty4x, jetty5x, jetty6x, jetty7x, jetty8x, jetty9x, jo1x, jonas4x, jonas5x, jrun4x, oc4j10x, oc4j9x, resin2x, resin31x, resin3x, resin4x, tomcat5x, tomcat6x, tomcat7x, tomcat8x, weblogic103x, weblogic10x, weblogic121x, weblogic12x, weblogic8x, weblogic9x, websphere85x, wildfly8x]
hrstoyanov commented 9 years ago

wildfly8x containerId still seems to be ok even against WildfLy 9 server, as a workaround.

bmuschko commented 9 years ago

At the moment the provided container ID is checked against a static list of valid IDs within the plugin. We'd just need to add the ID to this list. There are two alternatives:

1) I am going to remove this check overall. You'll get back a helpful error message from Cargo (hopefully). 2) Determine the list of valid container IDs dynamically though Cargo's API. Waiting for a community contribution here.

I am probably going to go for option 1.

hrstoyanov commented 9 years ago

Benjamin, Sounds good. The wildfly8x containerId workaround worked for me. Option 1 is good - the Wildfly guys are in rapid release mode, better not to pin down containers in static lists.

/Hristo Stoyanov On Sep 1, 2015 7:19 AM, "Benjamin Muschko" notifications@github.com wrote:

Closed #134 https://github.com/bmuschko/gradle-cargo-plugin/issues/134.

— Reply to this email directly or view it on GitHub https://github.com/bmuschko/gradle-cargo-plugin/issues/134#event-397379888 .