【问题标题】:How can grails "dependency error" be resolved?如何解决grails“依赖错误”?
【发布时间】:2013-04-29 01:25:56
【问题描述】:

在我决定重新安装之前,Grails 一直运行良好: 它现在开始在“运行应用程序”或创建应用程序命令过程中显示以下错误 -

  • 错误无法解决依赖关系(在 BuildConfig.groovy 中将日志级别设置为“警告”以获取更多信息):- org.grails.plugins:tomcat:2.2.1

详情

未解决的依赖关系 org.grails.plugins#tomcat;2.2.1:解决依赖关系时出现几个问题:org.grails.plugins#tomcat;2.2.1 {build=[default]}:模式 /Users/ 中位置 46 处的标记无效结尾Sanks/Documents/Startup/App-resources/1] grails development/Sandbox & Archive/emote reboot/lib/[artifact]-[revision].[ext]

*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"

// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
//   run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }
    log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

    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 e.g.

        // runtime 'mysql:mysql-connector-java:5.1.22'
    }

    plugins {
        runtime ":jquery:1.8.3"
        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.5"

        build ":tomcat:$grailsVersion"

        runtime ":database-migration:1.3.2"

    }
}

****将 Buildconfig 设置为“Warn”后* **************

| Loading Grails 2.2.1
| Configuring classpath
| Downloading: tomcat-2.2.1.pom.sha1
:: problems summary ::
:::: WARNINGS
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#tomcat;2.2.1: several problems occurred while resolving dependency: org.grails.plugins#tomcat;2.2.1 {build=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        ::::::::::::::::::::::::::::::::::::::::::::::
| Downloading: jquery-1.8.3.pom.sha1
| Downloading: resources-1.1.6.pom.sha1
| Downloading: database-migration-1.3.2.pom.sha1
| Downloading: zipped-resources-1.0.pom.sha1
| Downloading: facebook-graph-0.14.pom.sha1
| Downloading: cache-headers-1.1.5.pom.sha1
| Downloading: cached-resources-1.0.pom.sha1
| Downloading: mongodb-1.2.0.pom.sha1
:: problems summary ::
:::: WARNINGS
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#jquery;1.8.3: several problems occurred while resolving dependency: org.grails.plugins#jquery;1.8.3 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#resources;1.1.6: several problems occurred while resolving dependency: org.grails.plugins#resources;1.1.6 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#database-migration;1.3.2: several problems occurred while resolving dependency: org.grails.plugins#database-migration;1.3.2 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#zipped-resources;1.0: several problems occurred while resolving dependency: org.grails.plugins#zipped-resources;1.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#facebook-graph;0.14: several problems occurred while resolving dependency: org.grails.plugins#facebook-graph;0.14 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#cache-headers;1.1.5: several problems occurred while resolving dependency: org.grails.plugins#cache-headers;1.1.5 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#cached-resources;1.0: several problems occurred while resolving dependency: org.grails.plugins#cached-resources;1.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#mongodb;1.2.0: several problems occurred while resolving dependency: org.grails.plugins#mongodb;1.2.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        ::::::::::::::::::::::::::::::::::::::::::::::
| Downloading: jquery-1.8.3.pom.sha1
| Downloading: resources-1.1.6.pom.sha1
| Downloading: database-migration-1.3.2.pom.sha1
| Downloading: zipped-resources-1.0.pom.sha1
| Downloading: facebook-graph-0.14.pom.sha1
| Downloading: cache-headers-1.1.5.pom.sha1
| Downloading: cached-resources-1.0.pom.sha1
| Downloading: mongodb-1.2.0.pom.sha1
:: problems summary ::
:::: WARNINGS
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#jquery;1.8.3: several problems occurred while resolving dependency: org.grails.plugins#jquery;1.8.3 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#resources;1.1.6: several problems occurred while resolving dependency: org.grails.plugins#resources;1.1.6 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#database-migration;1.3.2: several problems occurred while resolving dependency: org.grails.plugins#database-migration;1.3.2 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#zipped-resources;1.0: several problems occurred while resolving dependency: org.grails.plugins#zipped-resources;1.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#facebook-graph;0.14: several problems occurred while resolving dependency: org.grails.plugins#facebook-graph;0.14 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#cache-headers;1.1.5: several problems occurred while resolving dependency: org.grails.plugins#cache-headers;1.1.5 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#cached-resources;1.0: several problems occurred while resolving dependency: org.grails.plugins#cached-resources;1.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        :: org.grails.plugins#mongodb;1.2.0: several problems occurred while resolving dependency: org.grails.plugins#mongodb;1.2.0 {runtime=[default]}:
    invalid end of token at position 22 in pattern /Users/Sanks/Dropbox/1]KeyThemes1/emote/Developer/AppDev/emote/lib/[artifact]-[revision].[ext]
        ::::::::::::::::::::::::::::::::::::::::::::::
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:tomcat:2.2.1

【问题讨论】:

  • 您是否尝试过清理.grails 目录中的projectivy?你在运行app之前用过grails cleangrails compile吗?
  • 尽管尝试了 clean 和 compile 命令,但错误没有变化。请注意,无论项目如何,我都会收到此错误。它正在影响所有新旧 Grails 项目。
  • 更新 - 错误已解决。解决方案 - 确保没有文件路径名称不包含任何特殊字符 - 在我的情况下包括“]”
  • 我也面临同样的问题。勾选(接受)答案对您有帮助吗?

标签: grails dependencies grails-2.2


【解决方案1】:

请在插件部分的 build.config 中添加此内容

compile (":kickstart-with-bootstrap:0.9.6") {
            excludes 'jquery'            
}

【讨论】:

    【解决方案2】:

    更新

    我们需要查看您的 BuildConfig.groovy,而不是胡乱猜测。 我的印象是您的解析器模式与您的布局结构不匹配,因为看起来您使用的是常春藤存储库。

    请给出更准确的答案,我们需要查看您的BuildConfig.groovy...否则,我们只能推测,但您的错误看起来很容易修复,您也可以打开调试。

    grails-app/conf/BuildConfig.groovy 中,更改行

    log "error"
    

    log "debug"
    

    之后,如果您不想粘贴任何代码,解决问题应该很容易。


    您显然在使用自定义的 ivy 解析器,也许您的解析器模式似乎错误。

    可能是您需要引用转义“&”符号(疯狂猜测)。我通常会避免文件夹名称或奇怪字符之间的那些空格。

    如果 @dmahapatro 的建议不起作用,请发布有关您的 BuildConfig.groovy 的更多详细信息。

    【讨论】:

    • 我现在改进了文件夹名称。但是错误仍然没有变化。
    • 此时我建议删除您的 .grails 文件夹。
    • 我已尝试多次删除 .grails 无济于事。我现在在原始问题中添加了新的警告消息输出,可能会提供更多线索,感谢任何帮助!
    猜你喜欢
    • 1970-01-01
    • 2015-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-13
    • 2013-11-29
    • 2021-05-03
    • 1970-01-01
    相关资源
    最近更新 更多