Closed vvursT closed 10 years ago
This is something that the Cargo library is doing. My plugin is just passing through the values to the Ant task. I'd ask about this on the Cargo mailing list.
Yes i suspected that. Thank you for bothering! Meanwhile my workaround will be to use a prepared tomcat installation.
I was struggling with the same issue today as well. The behaviour seems to be as per Cargos spec.
To get this working with gradle-cargo-plugin, just prepend "/" to the toDir file() ie
toDir = file('/lib')
If you use the file
method, Gradle creates a path relative to the project (except if it is an absolute path). This is not a feature added by the plugin. @vvursT Does this answer your question? If yes, please close the issue.
Seems like this question was answered.
Hey guys,
sorry for my late answer and thanks for the fast feedback. But i'm still having trouble with that issue.
@pgaschuetz I did that but the only effect that i have is that every file path i'm configuring is prepended by the given "configHomeDir" from the cargo configuration. Can you send my a bigger snippet of your whole cargo configuration. Maybe i can figure out the differences.
@bmuschko again thanks for your fast response. i upgraded all the given libraries to the suggested and still having this issue:
gradle: 1.11 org.gradle.api.plugins:gradle-cargo-plugin:1.4 org.codehaus.cargo:cargo-core-uberjar:1.4.5 org.codehaus.cargo:cargo-ant:1.4.5
You are right. file
creates a path like you described. But as i said, this path is always prepended by the configured configHomeDir
from the cargo config. Even if this isn't configured the default value is prepended. I'm with you saying must be a gradle or cargo-ant issue but i can't manage to figure out the real problem.
Maybe you have the time to send me your working example code. Sorry for your inconvenience.
Hey guys,
sorry for my late answer and thanks for the fast feedback. But i'm still having trouble with that issue.
@pgaschuetz I did that but the only effect that i have is that every file path i'm configuring is prepended by the given configHomeDir
from the cargo configuration. Can you send my a bigger snippet of your whole cargo configuration. Maybe i can figure out the differences.
@bmuschko again thanks for your fast response. i upgraded all the given libraries to the suggested and still having this issue:
gradle:1.11
org.gradle.api.plugins:gradle-cargo-plugin:1.4
org.codehaus.cargo:cargo-core-uberjar:1.4.5
org.codehaus.cargo:cargo-ant:1.4.5
You are right. file
creates a path like you described. But as i said, this path is always prepended by the configured configHomeDir
from the cargo config. Even if this isn't configured the default value is prepended. I'm with you saying must be a gradle or cargo-ant issue but i can't manage to figure out the real problem.
At least i figured out, that i made a fault pasting my example code. The file
closure is inside the local
closure.
Maybe you have the time to send me your working example code. Sorry for your inconvenience.
Hi,
I think I misunderstood your original question, but in any case, here is an excerpt:
apply plugin: 'cargo'
dependencies {
def cargoVersion = '1.4.7'
cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion"
cargo "org.codehaus.cargo:cargo-ant:$cargoVersion"
}
def wildflyDownloadDir = file("${System.properties['user.home']}/.cargo/download")
def wildflyConfigHomeDir = file("$buildDir/cargoconfig")
def wildflyHomeDir = file("${System.properties['user.home']}/.cargo/extract")
cargo {
containerId = 'wildfly8x'
port = 9090
local {
installer {
installUrl = "http://download.jboss.org/wildfly/8.0.0.Final/wildfly-8.0.0.Final.zip"
downloadDir = wildflyDownloadDir
extractDir = wildflyHomeDir
}
configHomeDir = wildflyConfigHomeDir
configFile {
file = file("src/cargo/resources/configuration/standalone.xml")
toDir = file('/configuration')
}
}
}
However, in order to deploy libraries to your containers lib directory, you may want to look at the extraClasspath option instead of copying them to the containers lib directory:
configurations {
cargoruntime
}
dependencies {
cargoruntime 'org.postgresql:postgresql:9.3-1100-jdbc41'
}
cargo {
...
local {
...
extraClasspath = configurations.cargoruntime
}
}
Hope this helps.
Hi,
First of all: my initial problem is solved. The extraClasspath configuration did the trick. Thank you!
At least the problem not being able to copy file with the configFile
closure still occurs, because the absolute configDirPath is prepended. No idea where it comes from. Can you tell me what cargo plugin version you are using?
I'm using the file closure inside local to deploy additional libraries to my container instance. My reference is your description
To add binary file(s) you should use file closure(s) instead:
As i use maven dependencies my cargo configuration looks like this
My intention is to put the 3rd party library into the tomcat 'lib' dir but im ending up having a file copy error:
So the given toDir path is prefixed by the configHomeDir-Path. As is searched through your code i'm not sure if this is an gradle-cargo-plugin or an cargo-ant issue.