2013-02-14 321 views
1

在我的gradle.properties文件上運行gradle build時出現以下錯誤。Gradle:錯誤列表版本的junit#junit; 4. +

我知道我在防火牆後面,我有一個我可以使用的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.+' 
} 

回答

0

根據不同的代理,你可能需要配置不僅僅是主機和端口等等。請參閱Gradle用戶指南中的Accessing the web via a proxy。另外,我建議嘗試使用固定版本而不是版本範圍。