【问题标题】:Grails: unable to resolve dependenciesGrails:无法解决依赖关系
【发布时间】:2013-04-18 22:57:59
【问题描述】:

我很难找出 grails 无法解决某些依赖项的原因。这是我在尝试编译/清理/运行应用程序时收到的错误消息:

==== localMavenResolver: tried 
        ....

==== http://grails.org/plugins: tried
        http://grails.org/plugins/grails-org.springframework.security.web/tags/RELEASE_3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://grails.org/plugins/grails-org.springframework.security.web/tags/RELEASE_3.0.4.RELEASE/grails-org.springframework.security.web-3.0.4.RELEASE.jar

        ==== grailsCentral: tried
        http://grails.org/plugins/grails-org.springframework.security.web/tags/RELEASE_3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://grails.org/plugins/grails-org.springframework.security.web/tags/RELEASE_3.0.4.RELEASE/grails-org.springframework.security.web-3.0.4.RELEASE.jar

        ==== http://repo.grails.org/grails/core: tried
        http://repo.grails.org/grails/core/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://repo.grails.org/grails/core/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.jar

        ==== http://snapshots.repository.codehaus.org: tried
        http://snapshots.repository.codehaus.org/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://snapshots.repository.codehaus.org/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.jar

        ==== http://repository.codehaus.org: tried
        http://repository.codehaus.org/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://repository.codehaus.org/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.jar

        ==== http://repository.jboss.com/maven2/: tried
        http://repository.jboss.com/maven2/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://repository.jboss.com/maven2/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.jar

        ==== http://download.java.net/maven/2/: tried
        http://download.java.net/maven/2/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.web;3.0.4.RELEASE!org.springframework.security.web.jar:
        http://download.java.net/maven/2/org/springframework/security/org.springframework.security.web/3.0.4.RELEASE/org.springframework.security.web-3.0.4.RELEASE.jar

        ==== localMavenResolver: tried 
        ....


        ==== http://grails.org/plugins: tried
        http://grails.org/plugins/grails-org.springframework.security.core/tags/RELEASE_3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
        -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://grails.org/plugins/grails-org.springframework.security.core/tags/RELEASE_3.0.4.RELEASE/grails-org.springframework.security.core-3.0.4.RELEASE.jar
            ==== grailsCentral: tried
              http://grails.org/plugins/grails-org.springframework.security.core/tags/RELEASE_3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://grails.org/plugins/grails-org.springframework.security.core/tags/RELEASE_3.0.4.RELEASE/grails-org.springframework.security.core-3.0.4.RELEASE.jar
            ==== http://repo.grails.org/grails/core: tried
              http://repo.grails.org/grails/core/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://repo.grails.org/grails/core/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar
            ==== http://snapshots.repository.codehaus.org: tried
              http://snapshots.repository.codehaus.org/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://snapshots.repository.codehaus.org/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar
            ==== http://repository.codehaus.org: tried
              http://repository.codehaus.org/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://repository.codehaus.org/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar
            ==== http://repository.jboss.com/maven2/: tried
              http://repository.jboss.com/maven2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://repository.jboss.com/maven2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar
            ==== http://download.java.net/maven/2/: tried
              http://download.java.net/maven/2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
        http://download.java.net/maven/2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar

        ==== mavenCentral: tried
              http://repo1.maven.org/maven2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.pom
              -- artifact org.springframework.security#org.springframework.security.core;3.0.4.RELEASE!org.springframework.security.core.jar:
              http://repo1.maven.org/maven2/org/springframework/security/org.springframework.security.core/3.0.4.RELEASE/org.springframework.security.core-3.0.4.RELEASE.jar


                ::::::::::::::::::::::::::::::::::::::::::::::
                ::          UNRESOLVED DEPENDENCIES         ::
                ::::::::::::::::::::::::::::::::::::::::::::::
                :: org.springframework.security#org.springframework.security.web;3.0.4.RELEASE: not found
                :: org.springframework.security#org.springframework.security.core;3.0.4.RELEASE: not found
                ::::::::::::::::::::::::::::::::::::::::::::::



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

        - org.springframework.security:org.springframework.security.web:3.0.4.RELEASE
        - org.springframework.security:org.springframework.security.core:3.0.4.RELEASE

这是我在 Buildconfig.groovy 中包含的内容:

        grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    repositories {
        grailsRepo "http://grails.org/plugins"
        grailsPlugins()
        grailsHome()
        grailsCentral()

        mavenRepo "http://snapshots.repository.codehaus.org"
        mavenRepo "http://repository.codehaus.org"
        mavenRepo "http://repository.jboss.com/maven2/"
}
    }
    plugins {
        compile ":tomcat:2.1.3"
        compile ":spring-security-core:1.2.7.3"

我猜春天的“安全核心取决于”“org.springframework.security.web 3.0.4.RELEASE”和“org.springframework.security.core 3.0.4.RELEASE”。我必须添加另一个插件或依赖项吗?

【问题讨论】:

  • 奇怪的是,正确的名字应该是org.springframework.security:spring-security-web:3.0.4.RELEASE,而不是org.springframework.security:org.springframework.security.web:3.0.4.RELEASE。但它来自哪里?

标签: grails spring-security dependencies


【解决方案1】:

尝试将mavenCentral() 添加到您的存储库列表中。

【讨论】:

  • 这也没有帮助:(
【解决方案2】:

原来我的项目依赖于一个旧版本的项目......

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-22
    • 2014-05-07
    • 1970-01-01
    • 2016-02-16
    • 2017-02-20
    相关资源
    最近更新 更多