grails - Intellij IDEA 11.0.2无法解决对Grails 2.0.0的依赖关系

标签 grails groovy intellij-idea

这是我在这里的第一个问题,希望尚未被问到。
问题:

每次我使用带有新Grails 2.0.0的Intellij IDEA 11.0.2 build 111.277创建新应用时,都会得到以下堆栈跟踪:

| Loading Grails 2.0.0
| Configuring classpath
:: problems summary ::
:::: WARNINGS
        module not found: org.grails.plugins#tomcat;1.3.7
    ==== grailsPlugins: tried
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/IdeaProjects/lib/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/ivy-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/jars/tomcat-1.3.7.zip
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/bundles/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/src/libs/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/src/libs/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/dist/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/dist/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/tomcat-1.3.7.zip
    ==== grailsHome: tried
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/plugins/tomcat-1.3.7.zip
        module not found: org.grails.plugins#hibernate;1.3.7
    ==== grailsPlugins: tried
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/IdeaProjects/lib/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/ivy-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/jars/hibernate-1.3.7.zip
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/bundles/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/src/libs/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/src/libs/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/dist/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/dist/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/hibernate-1.3.7.zip
    ==== grailsHome: tried
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/plugins/hibernate-1.3.7.zip
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#tomcat;1.3.7: not found
        :: org.grails.plugins#hibernate;1.3.7: not found
        ::::::::::::::::::::::::::::::::::::::::::::::

:: problems summary ::
:::: WARNINGS
        module not found: org.grails.plugins#tomcat;1.3.7
    ==== grailsPlugins: tried
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/IdeaProjects/lib/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/ivy-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/jars/tomcat-1.3.7.zip
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/tomcat/bundles/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/src/libs/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/src/libs/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/dist/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/dist/tomcat-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/tomcat-1.3.7.xml
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/tomcat-1.3.7.zip
    ==== grailsHome: tried
      -- artifact org.grails.plugins#tomcat;1.3.7!tomcat.zip:
      /home/Mircea/SDKs/grails-2.0.0/plugins/tomcat-1.3.7.zip
        module not found: org.grails.plugins#hibernate;1.3.7
    ==== grailsPlugins: tried
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/IdeaProjects/lib/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/ivy-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/jars/hibernate-1.3.7.zip
      /home/Mircea/SDKs/grails-2.0.0/lib/org.grails.plugins/hibernate/bundles/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/src/libs/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/src/libs/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/SDKs/grails-2.0.0/dist/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/dist/hibernate-1.3.7.zip
    ==== grailsHome: tried
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/hibernate-1.3.7.xml
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/.grails/2.0.0/cached-installed-plugins/hibernate-1.3.7.zip
    ==== grailsHome: tried
      -- artifact org.grails.plugins#hibernate;1.3.7!hibernate.zip:
      /home/Mircea/SDKs/grails-2.0.0/plugins/hibernate-1.3.7.zip
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#tomcat;1.3.7: not found
        :: org.grails.plugins#hibernate;1.3.7: not found
        ::::::::::::::::::::::::::::::::::::::::::::::

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

- org.grails.plugins:tomcat:1.3.7
- org.grails.plugins:hibernate:1.3.7

有什么想法吗?我已经在寻找解决方案,但没有完全找到我想要的东西。

最佳答案

检查BuildConfig.groovy上插件的硬编码版本号。它应该引用$grailsVersion:

grails.project.dependency.resolution = {
    . . .
    plugins {
        runtime ":hibernate:$grailsVersion"
        build ":tomcat:$grailsVersion"
        . . .
    }
    . . .
}

检查application.properties以确保它是正确的:
app.grails.version=2.0.0
plugins.hibernate=2.0.0
plugins.tomcat=2.0.0

还要在项目设置->全局库中检查IDEA Grails库的版本。

我刚刚修补到11.0.2,并成功创建了一个新的Grails 2.0.0项目。

您的Grails 2.0.0安装可能已损坏。尝试全新安装Grails:
  • 从IDEA中删除Grails 2.0.0全局库。
  • 将Grails 2.0.0安装到新目录中。
  • 在IDEA中创建一个新的Grails项目,然后使用“创建...”按钮设置新的安装。
  • 关于grails - Intellij IDEA 11.0.2无法解决对Grails 2.0.0的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9119768/

    相关文章:

    grails - Grails Controller 添加实例

    java - 关于 Grails 服务类 Singleton 属性

    java - Liferay 控制台 Groovy 脚本缺少方法错误

    java - Gradle:类没有这样的属性?

    grails - 如何使用外部服务作为Grails应用程序配置的来源?

    grails - 这个运算符叫什么,它用于 <=>

    java - 使用 Runtime.exec() 从 Java 代码调用 Python 脚本 : ImportError: No module named sklearn

    java - 如何从 IntelliJ IDEA 正确构建 JAR?

    mysql - Insert Into 添加双记录MySQL语句

    hibernate - 将 Grails 域类映射到 joinTable 的问题