Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Gradle无法解决依赖项:testRunTime_Java_Gradle - Fatal编程技术网

Java Gradle无法解决依赖项:testRunTime

Java Gradle无法解决依赖项:testRunTime,java,gradle,Java,Gradle,解决依赖关系需要花费大量时间,并且在解决依赖关系时陷入困境:testRuntime步骤 我的gradle文件如下所示: apply plugin: 'eclipse' apply plugin: 'maven' apply plugin: 'war' apply plugin: 'eclipse-wtp' apply plugin: 'java' ec

解决依赖关系需要花费大量时间,并且在解决依赖关系时陷入困境:testRuntime步骤

我的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
命令行选项

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


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

您是否在浏览器中尝试了所有这些repo URL?您是以信息(-i)模式还是调试(-d)模式运行gradle?我注意到您没有使用jcenter。为什么?我现在看到您正在使用jcenter()。其他问题仍然适用。我将尝试gradle和-dDid。您是否在浏览器中尝试所有这些repo URL?您是以信息(-i)模式还是调试(-d)模式运行gradle?我注意到您没有使用jcenter。为什么?我现在看到您正在使用jcenter()。其他问题仍然适用。我将尝试用-d来回答gradle