Matthias Koch wrote:
Hi all,
I have some problems when I which to copy files with gradle through scp.
My script looks as follow:
ant.scp(file: "myfile", todir: "u...@host:./", password: "xxxxx")
I always get the error from ant, that there is a missing jar for this ant
task.
But the jar (jsch) is still in the gradle / lib directory.
Did someone know what I have to do ?
It's (probably) complaining that ant-jsch.jar is missing. You have a few
options to fix this:
- Add ant-jsch-1.7.0.jar to $gradleHome/lib directory
- Use taskdef to define the scp task with a custom classpath:
configurations {
scp
}
dependencies {
scp 'org.apache.ant:ant-jsch:1.7.0'
}
task scp << {
ant.taskdef(name: 'scp2', classname:
'org.apache.tools.ant.taskdefs.optional.ssh.Scp', classpath:
configurations.scp.asPath)
ant.scp2(file: someFile, remoteToDir: 'u...@host:someDir', password:
'password')
}
Or is there a better solution to copy files with scp in gradle ?
Not yet. There's a couple of existing JIRA issues to make this work better:
- Easier ant optional tasks: http://jira.codehaus.org/browse/GRADLE-574
- Add an SCP task: http://jira.codehaus.org/browse/GRADLE-770
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email