Gradle:列出junit#junit的版本时出错;4.+;
在gradle.properties文件上运行Gradle:列出junit#junit的版本时出错;4.+;,junit,proxy,gradle,dependency-management,Junit,Proxy,Gradle,Dependency Management,在gradle.properties文件上运行gradle build时,我遇到以下错误 我知道我在防火墙后面,我有一个可以使用的poxy。我已经尝试将下面的内容添加到gradle.properties文件中,但是我无法下拉jUnit。感谢大家的帮助 systemProp.http.proxyHost=www.somehost.org systemProp.http.proxyPort=8080 错误: Error listing versions of junit#junit;4.+ usi
gradle build
时,我遇到以下错误
我知道我在防火墙后面,我有一个可以使用的poxy。我已经尝试将下面的内容添加到gradle.properties文件中,但是我无法下拉jUnit。感谢大家的帮助
systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
错误:
Error listing versions of junit#junit;4.+ using class
org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1.
Will attempt an alternate way to list versions. This behaviour has been
deprecated and is scheduled to be removed in Gradle 2.0
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':testRuntime'.
> Could not resolve junit:junit:4.+.
Required by:
:HealthMonitor:1.0
> Failed to list versions for junit#junit;4.+.
> Could not list versions using M2 pattern 'http://repo1.maven.org/maven2/
[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]'.
> Could not GET 'http://repo1.maven.org/maven2/junit/junit/'.
> Connection to http://repo1.maven.org refused
build.gradle:
apply plugin: 'java'
apply plugin: 'eclipse'
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Health Monitor', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}
根据代理的不同,您可能需要配置的不仅仅是主机和端口。请参见《Gradle用户指南》中的。此外,我建议尝试使用固定版本,而不是版本范围