Gradle stuck at Resolve dependencies :testRunTime



IT正在花费大量时间来解决依赖项,并且在解决依赖项:testuntime步骤中陷入困境。

我的gradle文件如下所示:

            apply plugin: 'eclipse'
            apply plugin: 'maven'
            apply plugin: 'war'
            apply plugin: 'eclipse-wtp'
            apply plugin: 'java'
            eclipse {
                classpath {
                   downloadSources=true
                }
            }
            war {
              baseName = 'abc'
            }
            dependencies {
                    // for OAuth 2.0
                    compile "org.springframework.security.oauth:spring-security-oauth2:$oauth2Version"
                    // for OAuth 1.0a
                    compile "org.springframework.security.oauth:spring-security-oauth:$oauth1Version"
                    //Spring main jars
                    compile "org.springframework:spring-context:$springVersion"
                    compile "org.springframework:spring-jdbc:$springVersion"
                    compile "org.springframework:spring-tx:$springVersion"
                    compile "org.springframework:spring-web:$springVersion"
                    compile "org.springframework:spring-webmvc:$springVersion"
                    //spring webflow
                    compile "org.springframework.webflow:spring-webflow:$springWebFlowVersion"
                    //spring data jpa
                    compile "org.springframework.data:spring-data-jpa:$springdatajpaVersion"
                    compile "mysql:mysql-connector-java:$mysqlconnectorverion"
                    compile "org.hibernate:hibernate-core:$hibernatecoreversion"
                    compile "org.hibernate:hibernate-entitymanager:$hibernatecoreversion"

                    //for mongodb driver
                    // compile "org.mongodb:mongodb-driver:$mongodbDriverVersion"
                    compile "org.mongodb:mongo-java-driver:$mongodbDriverVersion"
                    //spring data for mongodb.
                    compile "org.springframework.data:spring-data-mongodb:$springDataMongoDb"  
                    //sdk for aws 
                    compile "com.amazonaws:aws-java-sdk:$awsSdkVersion"
                    //for spring mail
                    compile "org.springframework:spring-context-support:$springMail"
                    compile "javax.mail:mail:$javaxMail"
                    //email template
                    compile "org.apache.velocity:velocity:$apacheVelocity"
                    compile "org.apache.velocity:velocity-tools:$apacheVelocityTools"
                    //for spring security
                    compile "org.springframework.security:spring-security-config:$springSecurityVersion"
                    compile "org.springframework.security:spring-security-taglibs:$springSecurityVersion"
                    compile "org.springframework.security:spring-security-web:$springSecurityVersion"
                    //for spring social
                    compile "org.springframework.social:spring-social-config:$springSocialVersion"
                    compile "org.springframework.social:spring-social-core:$springSocialVersion"
                    compile "org.springframework.social:spring-social-web:$springSocialVersion"
                    compile "org.springframework.social:spring-social-security:$springSocialVersion"
                    compile "org.springframework.social:spring-social-facebook:$springSocialFacebookVersion"
                    compile "org.springframework.social:spring-social-facebook-web:$springSocialFacebookVersion"
                    compile "org.springframework.social:spring-social-twitter:$springSocialTwitterVersion"
                    compile "org.springframework.social:spring-social-linkedin:$springSocialLinkedInVersion"
                    compile "org.springframework.social:spring-social-google:$springSocialGoogleVersion"

                    compile "org.apache.httpcomponents:httpclient:$httpclientVersion"
                    compile "javax.validation:validation-api:$javaxValidationVersion"
                    compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
                    compile "org.slf4j:slf4j-api:$slf4jVersion"
                    compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
                    compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
                    compile "log4j:log4j:$log4jVersion"
                    compile "cglib:cglib-nodep:$cglibVersion"
                    compile "javax.inject:javax.inject:$javaxInjectVersion"
                    //useful dependencies
                    compile "org.apache.commons:commons-lang3:$apacheCommon"
                    compile "com.google.guava:guava:$googleGuavaVersion"
                    compile "commons-fileupload:commons-fileupload:$fileUploadVersion"


                 //   providedCompile "javax.servlet:servlet-api:$servletApiVersion"
                    providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
                    providedCompile "javax.servlet.jsp:jsp-api:$jspApiVersion"
                    providedCompile "javax.servlet.jsp:javax.servlet.jsp-api:$javaxJspApiVersion"
                   // compile ("javax.servlet.jsp.jstl:jstl-api:$jstlVersion"){
                   // exclude group: 'javax.servlet', module: 'servlet-api'
                   // }
                    compile "org.glassfish.web:jstl-impl:$jstlVersion"
                    compile "org.sitemesh:sitemesh:$sitemeshVersion"
                    compile "joda-time:joda-time:$jodaVersion"
                    compile "com.google.code.gson:gson:$gsonVersion"
                   testCompile "junit:junit:$junitVersion"
                    //testCompile "org.testng:testng:6.9.6"
                    testRuntime "junit:junit:$junitVersion"
                //    compile "io.springfox:springfox-swagger2:2.1.1"
            }
            repositories {
                    maven { url 'http://maven.springframework.org/release' }
                    maven { url 'http://maven.springframework.org/milestone' }
                    maven { url 'http://maven.springframework.org/snapshot' }
                    maven { url 'http://download.java.net/maven/2' }
                    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
                    maven { url 'http://repo.spring.io/snapshot'}
                    mavenCentral()
                   // mavenLocal()
                    jcenter()
            }
            task wrapper(type: Wrapper) {
                gradleVersion = '2.3'
            }

请帮助-我无法解决这个问题以及如何解决这个问题。

当访问远程存储库出现问题(例如代理配置不正确)时,可以观察到此问题。

如果您已经在本地存储库中拥有所有依赖项,您可以尝试--offline命令行选项。

最新更新