摇篮蚂蚁FTP错误:" 425连接超时" [英] Gradle ant ftp error: "425 Connection timed out"
问题描述
我有一个问题,我的gradle构建脚本:
I have a problem with my gradle build script:
apply plugin: 'java'
/*
* Sources:
* http://stackoverflow.com/q/17201815/4490015
* https://github.com/Vazkii/Botania/blob/master/build.gradle
*/
repositories {
mavenCentral()
}
configurations {
ftpAntTask
}
/*
* Load configuration file.
*/
ext.priv = parseConfig(file('private.properties'))
/*
* Some project properties
*/
version = '0.0.1'
group = 'randers.notenoughvocab'
archivesBaseName = 'NotEnoughVocab'
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'
}
}
}
void ftp(Map args, Closure antFileset = {}) {
ant {
taskdef(name: 'ftp',
classname: 'org.apache.tools.ant.taskdefs.optional.net.FTP',
classpath: configurations.ftpAntTask.asPath)
Map ftpArgs = args + [ //some default options
verbose : 'yes',
server : priv.host,
userid : priv.user,
password: priv.pass
]
delegate.ftp(ftpArgs) {
antFileset.delegate = delegate
antFileset()
}
}
}
def parseConfig(File config) {
config.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
}
/**
* Uploads the javadoc to the server specified in private.properties
*/
task('uploadJavadoc', dependsOn: 'javadoc') << {
ftp(action: 'send') {
fileset(dir: 'build/docs/javadoc')
}
}
jar {
manifest {
attributes 'Main-Class': 'randers.notenoughvocab.main.NotEnoughVocab'
}
}
task('prepareBuild') {
ant.replace(file: 'src/main/java/randers/notenoughvocab/main/Reference.java', token: '@VERSION@', value: version)
}
build.dependsOn(tasks.prepareBuild)
我收到以下错误信息:
I get the following error message:
不能把文件:425无法到端口55080打开数据连接:连接超时
could not put file: 425 Could not open data connection to port 55080: Connection timed out
显然,它的工作原理<一个href=\"https://github.com/Vazkii/Botania/blob/e1e7fd4c89ddd8bebf89f7ecd6a37ab83ffd4210/build.gradle#L153-L167\"相对=nofollow>为他人的。
我在 private.properties
中指定的服务器正常工作与一个FTP客户端FileZilla的一样,我不超时。我也曾尝试与本地FTP服务器相同,但由于运输没有带宽限制,运输是瞬间。结果
我能做些什么,以prevent超时?而且是端口 55080
东西,我应该关心?
Apparently it works for others.
The server I specified in private.properties
works fine with a FTP client like FileZilla, I do not time out. I have also tried the same with a local FTP server, but since the transport has no bandwith limitation, the transport was instant.
What can I do to prevent the timeout? And is the port 55080
something I should be concerned about?
我也做了一些调试较早,我保证了 priv.host
, priv.user
和 priv.pass
变量包含正确的信息。
I also did some debugging earlier and I ensured the priv.host
, priv.user
and priv.pass
variables contained the correct information.
推荐答案
如果当您从您的家用电脑,通常是通过NAT映射,也没有一个公开路由的IP启动程序出现该错误,您可以尝试使用FTP被动模式。从 Ant任务文档,你应该简单地添加被动: 是的
你的 ftpArgs
。
If that error occurs when you launch your program from your home computer, which is usually NAT'ed and does not have a publicly routable IP, you may try to use FTP passive mode. From the Ant task documentation you should simply add passive: 'yes'
to your ftpArgs
.
FTP就是这样一个奇怪的协议:下载和上传文件的另一个连接打开的由服务器向客户端,这通常会导致headeaches家庭用户,没有公网IP谁。简单的解决方案被称为被动模式
FTP is such a weird protocol: for downloading and uploading files another connection is opened by the server to the client and this usually cause headeaches to home users, who do not have public IPs. The simple solution is called "passive mode"
这篇关于摇篮蚂蚁FTP错误:&QUOT; 425连接超时&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!