gpt4 book ai didi

grails - 获取错误编译期间发生 fatal error org.apache.tools.ant.BuildException:编译失败。在grails应用程序中

转载 作者:行者123 更新时间:2023-12-02 14:52:59 26 4
gpt4 key购买 nike

当我通过终端或使用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)



我正在使用grails 2.0。下面是当我通过ubuntu终端运行grails run-app时发生的情况。
    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 run-app时,它总是要求将tomcat和hibernate插件更新为最新版本。我不知道为什么会这样。关于此的任何建议。

它可以与tomcat和hibernate插件versons相关吗?

application.properties
    #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

最佳答案

一些建议。最可能的答案是apps.properties,它指定与BuildConfig.groovy不同的东西。

  • 您正在运行2.0.0。至少要尝试2.0.4,因为会有错误修复,怎么样?
  • BuildConfig.groovy看起来不像权威来源。例如专门将tomcat指定为2.0.0,因此您没有典型的升级问题,在2.3.x中,这些插件从$ grailsVersion移出。
    检查application.properties。其中的grails版本将为2.0.0-可以从启动中看到。此处可以将tomcat和hibernate版本指定为您在启动时看到的版本。
  • grails清理和/或删除主目录中的.grails目录。
  • 关于grails - 获取错误编译期间发生 fatal error org.apache.tools.ant.BuildException:编译失败。在grails应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19976241/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com