Last active
August 29, 2015 13:57
-
-
Save SQiShER/9416013 to your computer and use it in GitHub Desktop.
Gradle Cargo Plugin configuration example for isolated containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def availablePortFinder = AvailablePortFinder.createPrivate() | |
def tomcatDownloadUrl = 'http://.../apache-tomcat-7.0.50.zip' | |
def cargoHome = "$buildDir/cargo" | |
// ... | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.4.5' | |
} | |
} | |
apply plugin: 'cargo' | |
cargo { | |
containerId = 'tomcat7x' | |
deployable { | |
// ... | |
} | |
local { | |
homeDir = file(cargoHome) | |
configHomeDir = file(cargoHome) | |
installer { | |
installUrl = tomcatDownloadUrl | |
downloadDir = file("$buildDir/download") | |
extractDir = file("$buildDir/extract") | |
} | |
containerProperties { | |
property 'cargo.servlet.port', availablePortFinder.nextAvailable | |
property 'cargo.tomcat.ajp.port', availablePortFinder.nextAvailable | |
property 'cargo.rmi.port', availablePortFinder.nextAvailable | |
} | |
} | |
} | |
task createCargoHome() { | |
doLast { | |
if (!file(cargoHome).exists() && !file(cargoHome).mkdirs()) { | |
println "Failed to create directory '${cargoHome}'" | |
} | |
} | |
} | |
cargoStartLocal.finalizedBy cargoStopLocal | |
cargoStartLocal.dependsOn createCargoHome | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the example. I tried to use it, but I couldn't get it to work.
I had to fill in a few things to get as far as I did:
I also had to change the version of gradle-cargo-plugin to 1.4.1 or 1.5, because 1.4.5 could not be found.
But either way, I get this error: