一千萬個為什麽

搜索

Maven工件無法解決

我將spring和jboss存儲庫添加到我的pom.xml中,如下所示:


    MyProject
    http://www.myproject.com
    4.0.0
    com.myproject
    myproject
    1.0-SNAPSHOT
    war   
    
        
            com.sun.faces
            jsf-api
            2.1.3-b02
            provided
        
        
            com.sun.faces
            jsf-impl
            2.1.3_01
            provided
        
        
            javax.servlet
            jstl
            1.0.2
            runtime
        
        
            javax.servlet
            servlet-api
            3.0-alpha-1
            runtime
        
        
            taglibs
            standard
            1.1.2
            runtime
        

        <!-- SPRING DEPENDENCIES -->
          
            org.springframework  
            spring  
            3.0.6.RELEASE
        

        <!-- HIBERNATE DEPENDENCIES -->
          
            org.hibernate  
            hibernate  
            3.5.4-Final
        

        <!-- PRIMEFACES -->
        
            org.primefaces
            primefaces
            3.0.M4
        
        
            org.primefaces.themes
            aristo
            1.0.1
        

        <!-- OTHER DEPENDENCIES -->
        
            org.jsoup
            jsoup
            1.5.2
        
        
            commons-codec
            commons-codec
            1.5
        
        
            mysql
            mysql-connector-java
            5.1.18
            provided
        
        
            net.authorize
            java-anet-sdk
            1.4.2
        
        
            com.amazonaws
            aws-java-sdk
            1.2.12
        
        
            com.ocpsoft
            prettyfaces-jsf2
            3.3.2
        
        
            javax
            javaee-web-api
            6.0
            provided
        
        
            junit
            junit
            4.8.1
            test
        
    

    
        ${project.build.directory}/endorsed
        UTF-8
        1.6
        gfv3ee6
    

    
        
            jsf20
            Repository for library Library[jsf20]
            http://download.java.net/maven/2/
            default
        
          
            prime-repo  
            PrimeFaces Maven Repository  
            http://repository.primefaces.org  
            default 
        
        
            jboss-public-repository-group
            JBoss Public Maven Repository Group
            https://repository.jboss.org/nexus/content/repositories/releases/
            default
        
        
            spring-release
            Spring Release Repository
            http://maven.springframework.org/release
            default
        
    
    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                2.3.2
                
                    1.6
                    1.6
                    
                        ${endorsed.dir}
                    
                
            
            
                org.apache.maven.plugins
                maven-war-plugin
                2.1
                
                    false
                
            
            
                org.apache.maven.plugins
                maven-dependency-plugin
                2.1
                
                    
                        validate
                        
                            copy
                        
                        
                            ${endorsed.dir}
                            true
                            
                                
                                    javax
                                    javaee-endorsed-api
                                    6.0
                                    jar
                                
                            
                        
                    
                
            
        
        ${project.artifactId}
    
    <!--pluginRepositories>
        
            caucho
            Caucho
            http://caucho.com/m2
        
    

但是當我構建時,我收到一個錯誤:

The following artifacts could not be resolved: org.springframework:spring:jar:3.0.6.RELEASE, org.hibernate:hibernate:jar:3.5.4-Final: Could not find artifact org.springframework:spring:jar:3.0.6.RELEASE in jsf20 (http://download.java.net/maven/2/) -> [Help 1]

這就像maven只查看第一個存儲庫而不是為spring和hibernate定義的存儲庫。

Update: Ran with -X and -e options at command line but not very useful from what I can tell: http://pastebin.com/c7nPzBc2

最佳答案

該錯誤只是說它無法在java.net repo中找到,它應該繼續並檢查其他人,直到它找到一個確實擁有它。你應該能夠安全地忽略它。

此外,你為春天列出的網址似乎已經死了,當我試圖直接去那裏時它給我錯誤500。無論哪種方式,它都是不必要的,因為彈簧工件可以在maven中心找到(至少通過3.0.6列為你的依賴)。


經過一番調查後,我發現spring還沒有發布 spring 工件,因為 2.5.6 。您需要單獨指定每個工件。例如:

  
  org.springframework  
  spring-beans  
  3.0.6.RELEASE

  
  org.springframework  
  spring-jdbc  
  3.0.6.RELEASE

  
  org.springframework  
  spring-context  
  3.0.6.RELEASE

...

轉載註明原文: Maven工件無法解決