【问题标题】:Intellij IDEA 11.0.2 fails to resolve dependencies on Grails 2.0.0Intellij IDEA 11.0.2 无法解决对 Grails 2.0.0 的依赖关系
【发布时间】:2012-02-02 20:46:46
【问题描述】:

这是我在这里的第一个问题,我希望还没有被问到。 问题:

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

| 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

有什么想法吗?我已经搜索了解决方案,但没有完全找到我想要的。

【问题讨论】:

    标签: grails groovy intellij-idea


    【解决方案1】:

    检查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 项目并使用“创建...”按钮来设置新的安装。

    【讨论】:

    • 它们就像在 BuildConfig.groovy 中的那样。还有其他想法吗?
    • 项目设置 -> 全局库 -> Grails 2.0.0 版库
    • 插件 { 运行时 ":hibernate:$grailsVersion" 运行时 ":jquery:1.7.1" 运行时 ":resources:1.1.5" 构建 ":tomcat:$grailsVersion" } code跨度>
    • 我得到:$ grails clean |配置类路径 |错误 /home/.../IdeaProjects/TestG2 似乎不是 Grails 应用程序的一部分。 |错误在项目之外支持以下命令:如果我运行 grails create-app 我会遇到涉及这两个依赖项的相同错误。
    • 我仍然得到 |错误无法解决依赖关系(在 BuildConfig.groovy 中将日志级别设置为“警告”以获取更多信息): - org.grails.plugins:tomcat:1.3.7 - org.grails.plugins:hibernate:1.3.7 之后我已经将其安装在不同的文件夹中。
    猜你喜欢
    • 1970-01-01
    • 2021-03-24
    • 2016-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-29
    • 2016-03-10
    • 1970-01-01
    相关资源
    最近更新 更多