gpt4 book ai didi

grails - 从Grails 1.3.6升级到2.1.1,插件发疯

转载 作者:行者123 更新时间:2023-12-02 14:45:11 28 4
gpt4 key购买 nike

我使用的是Grails 1.3.6,部署 war 时上下文加载器出现问题。与run-app一起正常工作,但在run-war或war上不能正常工作。

用尽了所有想法之后,我认为将Grails升级到2.1.1可能会有所帮助,但我对自己而言只是一个更深的洞。

插件似乎来来往往。每次我退出STS并重新启动时,都会得到一组不同的插件。通过管理器或命令行安装它们不会安装它们,而卸载它们也不会卸载它们。例如,我已经多次将jquery升级到1.8.3,但是该项目在插件下仍显示jquery 1.8.0。卸载插件后,它仍会显示在插件下,但是当我再次卸载它时,它说它无法卸载,因为它尚未安装。

主要问题在于敏捷。无论我做什么,我的应用程序都无法解析grails.plugins.nimble.core.ProfileBase或属于nimble插件的任何其他类。

因此,使用敏捷作为测试用例:

在我的项目资源管理器中:plugins文件夹包含“nimble 0.4-SNAPSHOT”。

在application.properties中,行“plugins.nimble = 0.4-SNAPSHOT”。

在〜/ .grails / 2.1.1 / projects / MyProject / plugins中,存在一个带有源代码的nimble-0.4-SNAPSHOT文件夹。

在... / myProject / lib中,同时存在“nimble-0.4-SNAPSHOT.jar”和“nimble-0.4-SNAPSHOT.zip”,因为它在不同的位置上正在寻找一个 jar 或 zipper 。我只是将扩展名从.zip更改为.jar。

在Grails插件管理器中,nimble带有绿色的选中标记,表明已安装。

我的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") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "warn" // 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()

mavenLocal()
mavenCentral()

// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//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.20'
}

plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.0"
runtime ":resources:1.1.6"
//build ":nimble:0.4-SNAPSHOT"

// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0"
//runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.4"

build ":tomcat:$grailsVersion"

runtime ":database-migration:1.1"

compile ':cache:1.0.0'
}

}

那么,为什么我的应用程序不知道敏捷性?我尝试过“清理”,“刷新依赖项”,“编译”,并在每种可能的组合中重新启动均无济于事。

我认为这与未完全或正确地从Grails 1.3.6升级到2.1.1有关,但又有什么关系呢?

谢谢。

最佳答案

从1.3.6更改为2.1.1是一大步。我在列表中看到的现在可以想到的是:

  • 如果您的应用程序没有很多代码,则最好创建一个新的新鲜项目并复制源代码。
  • BuildConfig.groovy是现在声明依赖项的方法,请使用它而不是install-plugin(可能因为您的项目发疯了)

  • 如果无法创建新的新项目并复制文件,请尝试一些小步骤(先执行Grails 1.3.7,然后是2.0.4,然后是2.1.1)。

    关于grails - 从Grails 1.3.6升级到2.1.1,插件发疯,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13484060/

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