【问题标题】:move Grails project from older to newest version of Intellij Idea IDE将 Grails 项目从旧版本的 Intellij Idea IDE 迁移到最新版本
【发布时间】:2016-05-10 08:48:43
【问题描述】:

我在安装了 Idea 13 的机器上开发了我的 Grails 项目。 现在我搬到另一台机器上,并安装了最新版本的 IDE。

我已经安装了 Grails(2.2.1 版)和 Groovy(2.4.6 版),并提供了安装说明中描述的路径变量。我从现有源创建了一个新项目,但是当我尝试运行它时,它给了我关于插件的错误。

插件丢失,我无法在项目中安装,因为菜单工具 -> Grails -> 插件(或右键单击项目的根目录 -> Grails -> 插件)中的选项卡不存在。我尝试过创建一个全新的 Grails 项目,并且该选项卡存在,所以这可能取决于我导入项目的方式。

这里是 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}.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"

        // 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'

        compile ":ckeditor:4.4.1.0"


    }
}

这是 Grails 控制台中的错误:

Error |
Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):

- org.grails.plugins:cache:1.0.0
- org.grails.plugins:ckeditor:4.4.1.0

如何导入它而不在构建代码中收到错误?

编辑: 我创建了一个全新的项目。它安装默认插件,但不允许通过 Tools->Grails->Plugins 添加新插件

错误是(即log4j插件安装):

|Resolving plugin log4j-xml. Please wait...
|Error resolving plugin [name:log4j-xml, group:org.grails.plugins, version:0.2]. Plugin not found.
Error |
Plugin not found for name [log4j-xml] and version [0.2]

【问题讨论】:

  • 你能发布你得到的错误吗?谢谢
  • @Biswas 错误日志已添加
  • 你应该升级你的缓存和ckeditor插件。它们已过时,无法在 maven repo 中找到,因此您收到错误消息。将它升级到 cache:1.1.8 和 ckeditor:4.5.4.0 就可以了。供参考grails.org/plugin/cachegrails.org/plugin/ckeditor 谢谢
  • @Biswas 我已经更改了版本,但我有同样的错误

标签: grails intellij-idea


【解决方案1】:

我自己解决了这个问题。

解决方案与此处相同:Error Failed to resolve dependencies grails

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-12
    • 1970-01-01
    • 1970-01-01
    • 2013-03-24
    相关资源
    最近更新 更多