2013-04-18 251 views
0

我很難找出爲什麼grails無法解決某些依賴關係。這是錯誤消息在編譯/清潔/運行應用程序時,我得到: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" 

我猜春「安全 - 核心依賴「on」org.springframework.security.web 3.0.4.RELEASE「和」org.springframework.security.core 3.0.4.RELEASE「。我必須添加另一個插件或依賴項嗎?

+0

什麼奇怪,是正確的名稱將是'org.springframework.security:spring-security-web:3.0.4。 RELEASE',而不是'org.springframework.security:org.springframework.security.web:3.0.4.RELEASE'。但它來自哪裏? –

回答

0

原來我有一個老版本的一個項目,我的項目依賴的...

0

嘗試將mavenCentral()添加到您的存儲庫列表中。

+0

,沒有幫助任何:( – IwantToKnow