Intellij IDEA 11.0.2无法解决Grails 2.0.0上的依赖关系

时间:2012-02-02 20:46:47

标签: 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

有什么想法?我已经搜索了解决方案,但找不到我想要的东西。

1 个答案:

答案 0 :(得分:2)

检查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:

  1. 从IDEA删除Grails 2.0.0全局库。
  2. 将Grails 2.0.0安装到新目录中。
  3. 在IDEA中创建一个新的Grails项目,并使用“Create ...”按钮设置新安装。