提供者org.jetbrains.plugins.gradle.tooling.builder.WarModelBuilderImpl无法实例化

问题描述 投票:0回答:1

我正在编写Pro Spring MVC:With Web Flow一书的示例代码。

但是,当我尝试导入Gradle项目时收到以下错误:

原因:org.jetbrains.plugins.gradle.tooling.ModelBuilderService:提供程序org.jetbrains.plugins.gradle.tooling.builder.WarModelBuilderImpl无法实例化

这是父项目的build.gradle文件:

apply plugin: 'base'

ext.springVersion = '3.2.3.RELEASE'
ext.tilesVersion = '2.2.2'
ext.springSecurityVersion = '3.1.4.RELEASE'
ext.springSwfVersion = '2.3.2.RELEASE'
ext.hibernateVersion = '4.2.3.Final'
ext.hibernateValidatorVersion = '5.0.1.Final'
ext.ehCacheVersion = '2.7.2'
ext.aspectJVersion = '1.7.3'

ext.tomcatVersion = '7.0.42'
ext.cargoVersion = '1.3.3'

ext.webProjects = subprojects.findAll { project -> project.name.endsWith('bookstore') }

buildscript {
    repositories {
        maven { url 'http://jcenter.bintray.com/' }
    }

    dependencies {
        classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4'
        classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.5'
    }
}

allprojects {

    description = 'Bookstore Sample Application'

    group = 'com.apress.prospringmvc'

    version = '1.0.0'

    repositories {
        mavenRepo url: 'http://maven.springframework.org/release'
        mavenRepo url: 'http://maven.springframework.org/snapshot'
        mavenCentral()
        mavenRepo url: 'http://maven.springframework.org/milestone'
        mavenRepo url: 'https://repository.jboss.org/nexus/content/repositories/releases/'
        mavenRepo url: 'http://download.java.net/maven/glassfish/org/glassfish/'
    }

    tasks.withType(Compile) {
        options.compilerArgs << "-g"
    }
}

configure(webProjects) {
    apply plugin: 'war'
    apply plugin: 'jetty'
    apply plugin: 'tomcat'
    apply plugin: 'cargo'

    dependencies() {
        compile project(':bookstore-shared'), project(':bookstore-web-resources')

        compile "org.apache.tiles:tiles-servlet:$tilesVersion"
        compile "org.apache.tiles:tiles-jsp:$tilesVersion"
        compile "org.apache.tiles:tiles-api:$tilesVersion"
        compile "org.apache.tiles:tiles-core:$tilesVersion"

        runtime "jstl:jstl:1.2"

        providedCompile 'javax.servlet:javax.servlet-api:3.0.1'

        tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
                "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
        tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
            exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'

            cargo "org.codehaus.cargo:cargo-core-uberjar:${cargoVersion}",
                    "org.codehaus.cargo:cargo-ant:${cargoVersion}"
        }
    }

    cargo {
        containerId = 'tomcat7x'
        port = 8080

        local {
            homeDir = file('container/apache-tomcat-7.0.42')
            output = file('container/apache-tomcat-7.0.42/output.log')
        }
    }

    war {
        version = '' //We do this to make the wars versionless, when they are deployed with cargo, the context
        //root of the app is equal to the file name, which is equal to the sample directory name.
    }

    task systemTest(type: Test) {
        include '**/*FrontendTest.*'
        dependsOn(war)

        doFirst {
            cargoStartLocal.execute()
        }
    }

    test {
        exclude '**/*FrontendTest.*'
    }

}


subprojects() {
    apply plugin: 'java'
    apply plugin: 'eclipse-wtp'
    apply plugin: 'idea'

    sourceCompatibility = 1.7
    targetCompatibility = 1.7

    dependencies() {
        compile "org.springframework:spring-orm:$springVersion"
        compile "org.springframework:spring-aop:$springVersion"
        compile "org.springframework:spring-webmvc:$springVersion"
        compile "org.springframework:spring-oxm:$springVersion"

        compile 'org.slf4j:jcl-over-slf4j:1.7.2'
        compile 'ch.qos.logback:logback-classic:1.0.9'
        compile 'org.apache.commons:commons-lang3:3.0.1'
        compile 'com.thoughtworks.xstream:xstream:1.4.2'
        compile 'com.h2database:h2:1.3.168'
        compile 'cglib:cglib-nodep:2.2.2'
        compile "org.aspectj:aspectjrt:$aspectJVersion"
        compile "org.aspectj:aspectjweaver:$aspectJVersion"

        compile "org.hibernate:hibernate-entitymanager:$hibernateVersion"
        compile "org.hibernate:hibernate-core:$hibernateVersion"
        compile "org.hibernate:hibernate-ehcache:$hibernateVersion"
        compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
        compile "net.sf.ehcache:ehcache:$ehCacheVersion"

        compile 'com.lowagie:itext:2.1.7'
        compile 'net.sourceforge.jexcelapi:jxl:2.6.12'
        compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.11'
        compile 'commons-codec:commons-codec:1.6'
        compile 'joda-time:joda-time:2.1'

        testCompile 'junit:junit:4.11'
        testCompile "org.springframework:spring-test:$springVersion"
    }

    eclipse {
        project.natures "org.springframework.ide.eclipse.core.springnature"
    }

}

task wrapper(type: Wrapper) { gradleVersion = '1.6' }

我能做什么?

gradle intellij-idea
1个回答
0
投票

将gradle版本打造成我现在唯一的解决方案; 4.0应该工作:

更改:

task wrapper(type: Wrapper) { gradleVersion = '1.6' }

至:

task wrapper(type: Wrapper) { gradleVersion = '4.0' }

我试图解决它到目前为止使用1.7的其他方式 - 失败。

© www.soinside.com 2019 - 2024. All rights reserved.