获取错误编译过程中出现致命错误org.apache.tools.ant.BuildException:编译失败。在grails应用程序中

获取错误编译过程中出现致命错误org.apache.tools.ant.BuildException:编译失败。在grails应用程序中,grails,Grails,当我通过终端或使用grails/Groovy工具套件运行grails run app时,它会出现编译错误 `Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed (Use --stacktrace to see the full tr`ac`e) 我正在使用Grails2.0。下面是我通过ubuntu终端运行grails run应用程序时发生的情况 Lo

当我通过终端或使用grails/Groovy工具套件运行grails run app时,它会出现编译错误

`Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed (Use --stacktrace to see the full tr`ac`e)

我正在使用Grails2.0。下面是我通过ubuntu终端运行grails run应用程序时发生的情况

    Loading Grails 2.0.0
    | Configuring classpath.
    | Environment set to development.....
    | Packaging Grails application
    > You currently already have a version of the plugin installed [hibernate-2.0.0]. Do you want to update to [hibernate-3.6.10.2]? [y,n] n
    | Plugin hibernate-3.6.10.2 install aborted
    > You currently already have a version of the plugin installed [tomcat-2.0.0]. Do you want to update to [tomcat-7.0.42]? [y,n] n
    | Plugin tomcat-7.0.42 install aborted
    > You currently already have a version of the plugin installed [release-2.2.1]. Do you want to update to [release-3.0.1]? [y,n] n
    | Plugin release-3.0.1 install aborted
    | Plugin release-3.0.1 install aborted..
    Compiling 4 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed (Use --stacktrace to see the full trace

BuildConfig.groovy

当我运行grailsrun应用程序时,它总是要求将tomcat和hibernate插件更新到最新版本。我不知道为什么会这样。对此有什么建议吗

它是否与tomcat和hibernate插件versons有关

应用程序属性

*grails run app out*输出:


.

一些建议。最可能的答案是applications.properties指定与BuildConfig.groovy不同的内容

您正在运行2.0.0。至少试试2.0.4吧,因为会有bug修复

BuildConfig.groovy看起来不像权威的源代码。e、 tomcat被特别指定为2.0.0,因此您不会遇到典型的升级问题,在2.3.x中,这些插件从$grailsVersion迁移而来

检查application.properties。其中的grails版本将是2.0.0—从启动时就可以看到这一点。tomcat和hibernate版本可以在这里指定为您在启动中看到的版本

grails清理和/或删除主目录中的.grails目录


您好@interlated,我已经添加了application.properties文件。请看一看这个。hi@interlated,我刚刚卸载了插件版本2.2.1,现在Automatically插件版本3.0.1已经安装到我的系统中。为什么会发生这种情况。有什么想法吗?有-使用BuildConfig.groovy或application.properties-不要两者都使用.hi@interlated why Installed plugin release-3.0.1。在grails run应用程序失败时自动安装到应用程序。我更新了问题。你能看看这个吗。hi@interlated,我们能在BuildConfig.groovy中指定grails版本吗?不确定,但grails clean解决了我的问题
grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
    }
    log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve

    repositories {
        inherits true // Whether to inherit repository definitions from plugins
        grailsPlugins()
        grailsHome()
        grailsCentral()
        mavenCentral()

        // uncomment these to enable remote dependency resolution from public Maven repositories
        //mavenCentral()
        //mavenLocal()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

         runtime 'mysql:mysql-connector-java:5.1.16'
    }


    plugins {
        build ':release:2.2.1', ':rest-client-builder:1.0.3', {
      export = false
   }
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.7.1"
        runtime ":spring-security-core:1.2.7.2"
        runtime ':resources:1.2'
        runtime ":cached-resources:1.0"
        runtime ":zipped-resources:1.0"
        compile ":cache-headers:1.1.5"
        build ":tomcat:2.0.0"
        //compile ":attachmentable:0.3.0"
        compile ":searchable:0.6.4"
        compile ":cloud-bees:0.6.2"

        compile ":jquery-validation:latest.release"
        compile ":jquery-validation-ui:latest.release"
        compile ":twitter-bootstrap:2.3.2"
        compile ":lesscss-resources:1.3.3"
        runtime ":fields:1.3"
        compile ":mail:1.0.1"
        compile ":jquery-ui:1.8.24"
        compile ":spring-security-ui:0.2"
        compile ":mail:1.0"
        compile ":famfamfam:1.0"
        compile ":spring-security-acl:1.1.1"



    }
}
    #Grails Metadata file
    #Thu Nov 14 15:09:35 IST 2013
    app.grails.version=2.0.0
    app.name=VProcureFinal
    app.servlet.version=2.5
    app.version=0.1
    plugins.avatar=0.6.3
    plugins.burning-image=0.5.1
    plugins.class-diagram=0.5.2
    plugins.jquery-validation-ui=1.4.4
    plugins.prototype=1.0
    plugins.richui=0.8
plugins.webxml=1.4.1
 grails run-app
| Packaging Grails application
> You currently already have a version of the plugin installed [tomcat-2.0.0]. Do you want to update to [tomcat-7.0.42]? [y,n] n
| Installed plugin release-3.0.1
| Error Plugin release-3.0.1 requires version [2.3 > *] of Grails which your current Grails installation does not meet. Please try install a different version of the plugin or Grails.
| Installed plugin release-3.0.1