无法解决maven中的依赖关系

时间:2012-02-01 09:17:11

标签: maven maven-3

 [INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project enrollment: Could not resolve dependencies for project prex:enrollment:jar:1.0.0-SNAPSHOT: Failed to collect dependencies for 
[junit:junit:jar:4.7 (compile), javax.persistence:persistence-api:jar:1.0 (compile), prex:utils:jar:1.0.0-SNAPSHOT (compile), prex:plan-management:jar:1.0.0-SNAPSHOT (compile), prex:domain:jar:1.0
.0-SNAPSHOT (compile), prex:quotes-engine:jar:1.0.0-SNAPSHOT (compile), prex:service:jar:1.0.0-SNAPSHOT (compile), prex:individual-service:jar:1.0.0-SNAPSHOT (compile), org.
hibernate:hibernate-core:jar:3.3.2.GA (compile), org.hibernate:hibernate-entitymanager:jar:3.4.0.GA (compile), org.hibernate:hibernate-annotations:jar:3.4.0.GA (compile), org.slf4j:slf4j-api:jar:1.6.4
 (compile), org.slf4j:slf4j-log4j12:jar:1.6.4 (compile), org.slf4j:jcl-over-slf4j:jar:1.6.4 (compile), log4j:log4j:jar:1.2.14 (compile), org.springframework:spring-orm:jar:3.0.5.RELEASE (compile), org
.springframework:spring-core:jar:3.0.5.RELEASE (compile), org.springframework:spring-beans:jar:3.0.5.RELEASE (compile), org.springframework:spring-test:jar:3.0.5.RELEASE (compile), org.springframework
.security:spring-security-core:jar:3.0.5.RELEASE (compile), org.springframework.security:spring-security-config:jar:3.0.5.RELEASE (compile), org.springframework.security:spring-security-web:jar:3.0.5.
RELEASE (compile), org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE (compile), org.mybatis:mybatis-spring:jar:1.0.1 (compile), javax.validation:validation-api:jar:1.0.0.GA (compile),
 org.hibernate:hibernate-validator:jar:4.1.0.Final (compile), org.jibx:jibx-extras:jar:1.2.3 (compile), commons-codec:commons-codec:jar:1.4 (compile), org.ostermiller:utils:jar:1.07.00 (compile), comm
ons-dbcp:commons-dbcp:jar:1.2.2 (compile), commons-lang:commons-lang:jar:2.5 (compile), commons-io:commons-io:jar:2.0 (compile), org.springframework:spring-oxm:jar:3.0.5.RELEASE (compile), org.freemar
ker:freemarker:jar:2.3.18 (compile), javax.mail:mail:jar:1.4 (compile), org.drools:drools-decisiontables:jar:5.3.1.Final (compile), com.itextpdf:iText:jar:5.0.1 (compile), mysql:mysql-connector-java:j
ar:5.1.12 (test), org.apache.ibatis:ibatis-sqlmap:jar:2.3.0 (compile)]: Failed to read artifact descriptor for prex:service:jar:1.0.0-SNAPSHOT: Could not transfer artifact prex:servi
ce:pom:1.0.0-SNAPSHOT from/to Version99 (http://no-commons-logging.zapto.org/mvn2): Error transferring file: no-commons-logging.zapto.org: Unknown host no-commons-logging.zapto.org -> [Help 1]

我在哪里错过了什么?

这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <artifactId>parent-build</artifactId>
    <groupId>prex</groupId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../../parent-build/pom.xml</relativePath>
</parent>
<groupId>individual</groupId>
<artifactId>individual-webapp</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>individual web-app</name>
<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <property>
                <name>env</name>
                <value>windows</value>
            </property>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <struts.devMode>true</struts.devMode>
            <app.mode>dev</app.mode>
            <log.level>WARN</log.level>
            <global.properties>C:/application.properties</global.properties>
        </properties>
    </profile>
    <profile>
        <id>prod</id>
        <activation>
            <property>
                <name>env</name>
                <value>linux</value>
            </property>
        </activation>
        <properties>
            <app.mode>prod</app.mode>
            <struts.devMode>false</struts.devMode>
            <log.level>WARN</log.level>
            <global.properties>/usr/local/application.properties</global.properties>
        </properties>
    </profile>
</profiles>
<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <includes>
                <include>**/*</include>
            </includes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <overlays>
                    <overlay>
                        <groupId>prex</groupId>
                        <artifactId>web-template</artifactId>
                    </overlay>
                </overlays>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>yuicompressor-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>jslint</goal>
                        <goal>compress</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <aggregations>
                    <aggregation>
                        <removeIncluded>false</removeIncluded>
                        <insertNewLine>true</insertNewLine>
                        <output>${project.build.directory}/${project.build.finalName}/css/individual-${css.version}.css</output>
                        <includes>
                            <include>${project.build.directory}/${project.build.finalName}/css/individual-min.css</include>
                        </includes>
                    </aggregation>
                </aggregations>
                <!-- files to exclude, path relative to output's directory -->
                <excludes>
                    <exclude>**/*.properties</exclude>
                    <exclude>**/*.xls</exclude>
                    <exclude>**/*.xsd</exclude>
                    <exclude>**/*.xml</exclude>
                    <exclude>**/jquery/*</exclude>
                    <exclude>**/*.ftl</exclude>
                    <exclude>**/*.drl</exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
            <groupId>org.apache.ibatis</groupId>
            <artifactId>ibatis-sqlmap</artifactId>
            <version>2.3.0</version>
        </dependency>
    <dependency>
        <groupId>prex</groupId>
        <artifactId>web-template</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>war</type>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>prex</groupId>
        <artifactId>quotes-engine</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>prex</groupId>
        <artifactId>plan-management</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>

    <!--Utils -->
    <dependency>
        <groupId>prex</groupId>
        <artifactId>utils</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>prex</groupId>
        <artifactId>domain</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <!--Service -->
    <dependency>
        <groupId>prex</groupId>
        <artifactId>enrollment</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>prex</groupId>
        <artifactId>service</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jsp-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>sitemesh</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!--Spring framework dependencies start here -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-acl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jibx</groupId>
        <artifactId>jibx-run</artifactId>
        <version>1.2.3</version>
    </dependency>
    <!--Spring framework dependencies end here -->


    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <version>2.3</version>
        <classifier>jdk15</classifier>
    </dependency>
    <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <scope>runtime</scope>
    </dependency>
    <!-- Jackson JSON Processor -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>3.0.0.RELEASE</version>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>persistence-api</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.1.8.1</version>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>iText</artifactId>
        <version>5.0.1</version>
    </dependency>

    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>quartz</artifactId>
        <version>1.6.3</version>
        <scope>runtime</scope>
    </dependency>       
</dependencies>
<properties>
    <js.version>1.0.0</js.version>
    <css.version>1.0.0</css.version>
</properties>

现在错误是:

[ERROR] Failed to execute goal on project individual-webapp: Could not resolve dependencies for project individual:individual-webapp:war:1.0.0-SNAPSHOT: 
Failed to collect dependencies for [org.apache.ibatis:ibatis-sqlmap:jar:2.3.0 (compile), prex:web-template:war:1.0.0-SNAPSHOT (runtime), prex:quotes-engine:jar:1.0.0-SNAPSHOT (compile), prex:plan-management:jar: 1.0.0-SNAPSHOT (compile), 
prex:utils:jar:1.0.0-SNAPSHOT (compile), prex:domain:jar:1.0.0-SNAPSHOT (compile), prex:enrollment:jar:1.0.0-SNAPSHOT (compile), prex:service:jar:1.0.0-SNAPSHOT (compile), 
prex:individual-service:jar:1.0.0-SNAPSHOT (compile), prex:small-business-service:jar:1.0.0-SNAPSHOT (compile), javax.servlet:servlet-api:jar:2.5 (provided), 
javax.servlet:jsp-api:jar:2.0 (provided), javax.servlet:jstl:jar:1.2 (runtime), opensymphony:sitemesh:jar:2.4.2 (runtime), org.springframework:spring-context:jar:3.0.5.RELEASE (compile), 
org.springframework.security:spring-security-config:jar:3.0.5.RELEASE (runtime), org.springframework.security:spring-security-web:jar:3.0.5.RELEASE (compile), 
org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE (compile), org.springframework.security:spring-security-taglibs:jar:3.0.5.RELEASE (compile), 
org.springframework:spring-aspects:jar:3.0.5.RELEASE (compile), org.springframework:
spring-webmvc:jar:3.0.5.RELEASE (compile), org.springframework:springaop:jar:3.0.5.RELEASE (compile), org.jibx:jibx-run:jar:1.2.3 (compile), 
net.sf.json-lib:json-lib:jar:jdk15:2.3 (compile), com.jcraft:jsch:jar:0.1.44-1 (runtime), org.codehaus.jackson:jackson-mapper-asl:jar:1.6.4 (compile), org.springframework:spring-oxm:jar:3.0.0.RELEASE (compile), 
com.thoughtworks.xstream:xstream:jar:1.3.1 (compile), javax.persistence:persistence-api:jar:1.0 (compile), org.apache.struts:struts2-core:jar:2.1.8.1 (compile), 
com.itextpdf:iText:jar:5.0.1 (compile), opensymphony:quartz:jar:1.6.3 (runtime)]: 
Failed to read artifact descriptor for opensymphony:quartz:jar:1.6.3: 
Could not transfer artifact opensymphony:quartz:pom:1.6.3 from/to Version99 (http://no-commons-logging.zapto.org/mvn2): 
Error transferring file: no-commons-logging.zapto.org: Unknown host no-commons-logging.zapto.org -> [Help 1]

3 个答案:

答案 0 :(得分:0)

存储库http://no-commons-logging.zapto.org/mvn2不存在。

请显示pom.xml文件的“存储库”部分。

答案 1 :(得分:0)

如果您出于某种原因需要使用Here,则

Version99是建议的解决方法。它可能是一个传递依赖,因此不会出现在指定的pom中。

答案 2 :(得分:0)

在pom.xml get dependencies from here

中添加缺失的依赖项