bmuschko / gradle-cargo-plugin

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

cargoRunLocal always fail with existing Tomcat installation #190

Closed llcui00 closed 5 years ago

llcui00 commented 5 years ago

I have Tomcat 9 installed in my local environment. I have the following configuration section in Gradle:

cargo { containerId = 'tomcat9x' port = 8080

deployable {
    file = file('C:\\abc.war')
    context = 'abc'
}

local {
    homeDir = file('D:\\apache-tomcat-9.0.14')
    outputFile = file('D:\\apache-tomcat-9.0.14\\output.log')
    timeout = 60000
    }

}

When I run gradle cargoRunLocal --stacktrace I always get the following error:

FAILURE: Build failed with an exception.

bmuschko commented 5 years ago

What version of the plugin are using?

llcui00 commented 5 years ago

The version of the plugin is 2.5 buildscript { repositories { jcenter() }

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

}

Cargo version is 1.7.2

def cargoVersion = '1.7.2'
cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",
        "org.codehaus.cargo:cargo-ant:$cargoVersion"
bmuschko commented 5 years ago

This is highly likely due to the changes made in https://github.com/bmuschko/gradle-cargo-plugin/pull/176. The fields downloadDir and extractDir became mandatory properties meaning you have to assign a value. It is debatable whether they should be mandatory. That depends on the Cargo Ant task. It might handle it just fine if they would be optional.

llcui00 commented 5 years ago

I have just tried 2.4 plugin. It seems don't have the problem. Could you please make the fix so that it can support existing installation? Thanks.

bmuschko commented 5 years ago

I won't have the time to make a fix. Sorry. Would you feel comfortable with providing a pull request? Alternatively, @erdi might have some time as he introduced the change.

erdi commented 5 years ago

I will take a look tomorrow, should be an easy fix.