configurations {
ftpAntTask
}
repositories {
mavenCentral()
}
dependencies {
ftpAntTask("org.apache.ant:ant-commons-net:1.8.4") {
module("commons-net:commons-net:1.4.1") {
dependencies "oro:oro:2.0.8:jar"
}
}
}
task uploadFTP << {
//上传至FTP
ant {
taskdef(name: 'ftp',
classname: 'org.apache.tools.ant.taskdefs.optional.net.FTP',
classpath: configurations.ftpAntTask.asPath)
ftp(server: "192.168.2.105",
userid: "tangzhixu",
password: "123456") {
fileset(dir: PROJECT_DIR) {
include(name:"upload.zip")
}
}
}
}
Gradle FTP上传文件
点赞
收藏