How to ftp a file?

hi, newbie here. i want to add an ftp task to my build file (i think).

i want to upload a jar file (the one built by the jar task in this case) to my web site.

this is a delivery as it will be run as an applet.

i have found some info on the ant ftp task. should i use this? if so, can someone point me to a simple example?

any pointers will be appreciated.

thanks

There are multiple ways of doing it. One simple solution is to use this plugin:
https://gradle-ssh-plugin.github.io

i am trying that. mow stuck on missing known hosts. investigating.

also, i did not receive any email about the reply to my post even though the new forum stuff says that i am watching it.

i don’t have any keys for the web server i am delivering to, just a login and password.

thanks

The plugin loads the known hosts from the ~/.ssh folder, you should link it to a file in your project (or disable it for testing). You’ll find the necessary info in the documentation: https://gradle-ssh-plugin.github.io/user-guide.html#set-connection-settings

i copied a known hosts file from cygwin into the my userdir/.ssh so it’s going further.

now it says: “Auth fail” which seems reasonable as this is may be some old key or something.

i will look at the doc you suggested.

thanks

put a password into the remotes closure, now the ssh.run closure is executing.

more later.

thanks.

task checkWebServer << {
ssh.run {
put from: ‘build/libs/go2-0.2.jar’, into: ‘html/go/go2.jar’
}
}
}

works like a charm!

still not getting any emails.

how do i mark this thread done?

thanks

oops, missed a line. this is wjat worked:

task checkWebServer << {
ssh.run {
session(remotes.web1) {
put from: ‘build/libs/go2-0.2.jar’, into: ‘html/go/go2.jar’
}
}
}

thanks

You’re welcome.
For the email notification please check your preferences at https://discuss.gradle.org/users/${yourusername}/preferences
There are several settings to coordinate how to get notified. If confused please open a new topic for it.
I’m going to close this topic.