获取错误 编译期间出现致命错误 org.apache.tools.ant.BuildException: 编译失败.在圣



当我通过终端或使用Grails/Groovy工具套件运行grails运行应用程序时,它得到"编译错误"

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

.

我正在使用圣杯 2.0。以下是当我通过 ubuntu 终端运行 grails 运行应用程序时会发生什么。

    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

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 运行应用程序时,它总是要求将 tomcat 和休眠插件更新到最新版本。我不知道为什么会这样。对此有任何建议。

它可以与雄猫和休眠插件 verson 有关吗?

应用程序属性

    #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

.

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

  1. 您正在运行 2.0.0。至少尝试 2.0.4 怎么样,因为会有错误修复?

  2. 例如,tomcat被指定为2.0.0,因此您没有典型的升级问题,在2.3.x中,这些插件从$grailsVersion中移动。

    检查应用程序属性。那里的 grails 版本将是 2.0.0 - 可以从启动中看到这一点。tomcat 和休眠版本可以在此处指定为您在启动中看到的版本。

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

最新更新