当我尝试编译grails项目时,出现上述错误。
这是build.gradle文件。
当我编译项目时



总时间:7.554秒
|错误无法解析配置':testRuntime'的所有依赖项。键入“渐变依赖项”以获取更多信息

    buildscript {
    ext {
        grailsVersion = project.grailsVersion
    }
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'
    }
}

plugins {
    id "io.spring.dependency-management" version "0.5.2.RELEASE"
}

version "0.1"
group "org.emr.samatvam"

apply plugin: "spring-boot"
apply plugin: "war"
apply plugin: "asset-pipeline"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"

ext {
    grailsVersion = project.grailsVersion
    gradleWrapperVersion = project.gradleWrapperVersion
}

assets {
    minifyJs = true
    minifyCss = true
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://repo.grails.org/grails/core" }

}

dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}

dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
   // build ":tomcat:7.0.52.1"
   // compile "org.grails.plugins:migrate2-grails3:0.3.2"
    compile ":spring-security-core:2.0-RC5"
    // plugins for the compile step
    //compile ":scaffolding:2.0.2"
     //   compile 'org.grails.plugins:cache:1.1.1'
         compile "org.grails.plugins:mail:1.0.7"
         compile "org.grails.plugins:calendar:1.2.1"
         compile "org.grails.plugins:jquery-ui:1.10.4"
         compile "org.grails.plugins:joda-time:1.5"
        compile "org.grails.plugins:rest:0.8"
        compile "org.grails.plugins:mongodb:3.0.1"
        // plugins needed at runtime but not for compilation
       // runtime ":hibernate:3.6.10.9" // or ":hibernate4:4.3.4"
       // runtime ":database-migration:1.3.8"
        runtime "org.grails.plugins:jquery:1.11.0.2"
        runtime "org.grails.plugins:resources:1.2.7"
        runtime 'org.grails.plugins:twitter-bootstrap:3.3.5'

    //compile "org.grails.plugins:hibernate"
    compile "org.grails.plugins:cache"
    //compile "org.hibernate:hibernate-ehcache"
    compile "org.grails.plugins:scaffolding"

    runtime "org.grails.plugins:asset-pipeline"

    //testCompile "org.grails:grails-plugin-testing"
    //testCompile "org.grails.plugins:geb"

    // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
    //testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

    console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
    gradleVersion = gradleWrapperVersion
}

最佳答案

您使用的Mongo插件版本不正确。只有this versions可以与Grails 3一起使用。

检查其他插件,所有插件都必须在bintray.com/grails

请记住,Grails 5可以使用新的Gorm 5,这是与MongoDB一起使用的最佳方法。检查this

关于grails - Grails 3.0.6 build.gradle错误无法解析配置 ':testRuntime'的所有依赖项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35002984/

10-11 22:21
查看更多