Maven:无法收集依赖项

时间:2011-09-29 02:48:42

标签: maven

我已经导出了一个Maven项目。 (所以我没有和我一起设置settings.xml文件)

当我运行Mavens POM.xml文件时,由于这个reasson

,构建失败了
  

无法在项目bayer-ws上执行目标:无法解决   项目com.tata的依赖项:bayer-ws:war:1.0:无法收集   [com.tata:bayer-util:jar:1.0(compile)的依赖关系,   com.tata:bayer-model:jar:1.0(编译),com.tata:bayer-samples:jar:1.0   (编译),com.tata:bayer-mw:jar:1.0(编译),   com.tata:bayer-fixml:jar:1.0(编译),cglib:cglib-nodep:jar:2.1_3   (运行时),jdom:jdom:jar:1.1(编译),   org.apache.ws.commons.schema:XmlSchema:jar:1.4.5(运行时),   javax.servlet:servlet-api:jar:2.5(提供),junit:junit:jar:4.4   (测试),org.easymock:easymockclassextension:jar:2.3(测试),   org.easymock:easymock:jar:2.3(测试),   org.apache.cxf:cxf-rt-bindings-http:jar:2.2.1(compile),   org.apache.cxf:cxf-rt-ws-security:jar:2.2.1(编译),   org.apache.derby:derby:jar:10.3.1.4(test),   org.springframework:spring-beans:jar:2.5.2(编译),   org.springframework:spring-context:jar:2.5.2(编译),   org.springframework:spring-core:jar:2.5.2(编译),   org.springframework:spring-web:jar:2.5.2(编译),   log4j:log4j:jar:1.2.14(运行时),   commons-logging:commons-logging:jar:1.1.1(运行时),   com.tata:middleware:jar:5.0.0(compile),com.tata:PRO:jar:1.0.0   (编译),com.tata:legacy.backoffice:jar:1.0.0(编译),   hessian:hessian:jar:3.0.8(编译),   commons-httpclient:commons-httpclient:jar:3.1(运行时),   xstream:xstream:jar:1.2.2(编译),bouncycastle:bcprov-jdk16:jar:140   (运行时),org.apache.ws.security:wss4j:jar:1.5.8(编译),   net.sf.ehcache:ehcache-core:jar:2.4.1(运行时)]:无法读取   commons-logging的工件描述符:commons-logging:jar:99.1:   无法传输工件commons-logging:commons-logging:pom:99.1   从/到maven-central(http://repo1.maven.org/maven/):没有连接器   可用于访问存储库maven-central   (http://repo1.maven.org/maven/)使用可用的遗产类型   工厂AsyncRepositoryConnectorFactory,   WagonRepositoryConnectorFactory - > [帮助1]


//之前

 <repositories>
            <repository>
                <id>central</id>
                <url>http://repo1.maven.org/maven2</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
            <repository>
                <id>codehaus</id>
                <url>http://repository.codehaus.org/</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
            <repository>
                <id>Apache Incubating Repository</id>
                <url>http://people.apache.org/repo/m2-incubating-repository</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
            <repository>
                <id>apache-snapshot</id>
                <name>Apache Maven Snapshot</name>
                <url>http://people.apache.org/repo/m2-snapshot-repository</url>
                <releases>
                    <enabled>false</enabled>
                    <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
            <repository>

<repositories>
        <repository>
            <id>central</id>
            <url>http://nexus.sonatype.org/url>  <!--Here i did a change-->
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>codehaus</id>
            <url>http://repository.codehaus.org/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>Apache Incubating Repository</id>
            <url>http://people.apache.org/repo/m2-incubating-repository</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>apache-snapshot</id>
            <name>Apache Maven Snapshot</name>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
            <releases>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>

2 个答案:

答案 0 :(得分:1)

您似乎正在尝试访问Maven 1遗留存储库。

请检查这个答案:

How to use a maven 1 repository with maven 2?

Nexus repository manager能够为Maven {2,3}客户端代理Maven 1存储库。”

答案 1 :(得分:1)

你错过了“&lt;”在您的结束网址标记

<repositories>
    <repository>
        <id>central</id>
        <url>http://nexus.sonatype.org</url>  <!--Here is your problem-->
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
    <repository>
        <id>codehaus</id>
        <url>http://repository.codehaus.org/</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
    <repository>
        <id>Apache Incubating Repository</id>
        <url>http://people.apache.org/repo/m2-incubating-repository</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
    <repository>
        <id>apache-snapshot</id>
        <name>Apache Maven Snapshot</name>
        <url>http://people.apache.org/repo/m2-snapshot-repository</url>
        <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
    <repository>