Maven项目" maven install"错误

时间:2015-07-30 09:21:07

标签: java maven

[ERROR] Failed to execute goal on project xserver-api: 
Could not resolve dependencies for project xgroup:xserver-api:war:1.0.1-SNAPSHOT: 
Failed to collect dependencies at xgroup:xserver-lib:jar:1.0.1-SNAPSHOT: 
Failed to read artifact descriptor for xgroup:xserver-lib:jar:1.0.1-SNAPSHOT: 
Could not find artifact xgroup:xserver:pom:1.0.1-SNAPSHOT -> [Help 1]
谁能帮我解决这个问题? 非常感谢你!

打击是pom文件: 我不知道哪里有问题:



   <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>

<name>Xserver API</name>
<packaging>war</packaging>
<artifactId>xserver-api</artifactId>

<parent>
	<groupId>xgroup</groupId>
	<artifactId>xserver</artifactId>
	<version>1.0.1-SNAPSHOT</version>
</parent>

<properties>
	<javax.servlet-api>3.0.1</javax.servlet-api>
	<javax.servlet-jstl>1.2</javax.servlet-jstl>
	<maven-war-plugin>2.4</maven-war-plugin>
</properties>
&#13;
&#13;
&#13;

这是xgroup的pom:xser​​ver-lib.jar:1.0.1-SNAPSHOT

<modelVersion>4.0.0</modelVersion>

<name>Xserver Lib</name>
<packaging>jar</packaging>
<artifactId>xserver-lib</artifactId>

<!-- parent -->
<parent>
    <groupId>xgroup</groupId>
    <artifactId>xserver</artifactId>
    <version>1.0.1-SNAPSHOT</version>
</parent>

<!-- properties -->
<properties>
    <!-- dependencies -->
    <javax.servlet-api>3.0.1</javax.servlet-api>
    <org.springframework>3.2.13.RELEASE</org.springframework>
    <org.codehaus.jackson>1.9.7</org.codehaus.jackson>
    <org.mybatis-mybatis>3.1.1</org.mybatis-mybatis>
    <org.mybatis-mybatis-spring>1.1.1</org.mybatis-mybatis-spring>
    <mysql>5.1.20</mysql>
    <c3p0>0.9.1.2</c3p0>
    <commons-httpclient>3.1</commons-httpclient>
    <org.slf4j>1.6.6</org.slf4j>
    <log4j>1.2.17</log4j>
    <cglib>3.1</cglib>
    <commons-net>3.3</commons-net>
    <javax.jms>2.0</javax.jms>
    <com.rabbitmq>3.4.4</com.rabbitmq>
    <activemq>5.9.1</activemq>
    <jedis>2.6.0</jedis>
    <xmemcached>2.0.0</xmemcached>
</properties>

<!-- dependencies -->
<dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>${javax.servlet-api}</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${org.springframework}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${org.springframework}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>${org.codehaus.jackson}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>${org.mybatis-mybatis}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>${org.mybatis-mybatis-spring}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mysql}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>c3p0</groupId>
        <artifactId>c3p0</artifactId>
        <version>${c3p0}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>${commons-httpclient}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${org.slf4j}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${org.slf4j}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j} </version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>${cglib}</version>
    </dependency>

    <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>${commons-net}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>javax.jms-api</artifactId>
        <version>${javax.jms}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-all</artifactId>
        <version>${activemq}</version>
    </dependency>
    <dependency>
        <groupId>com.rabbitmq</groupId>
        <artifactId>amqp-client</artifactId>
        <version>${com.rabbitmq}</version>
    </dependency>

    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>${jedis}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.googlecode.xmemcached</groupId>
        <artifactId>xmemcached</artifactId>
        <version>${xmemcached}</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

1 个答案:

答案 0 :(得分:0)

您的maven项目结构似乎已经破裂。如果您首先clean install您的父项目(xgroup:xserver:pom:1.0.1-SNAPSHOT)然后clean install您的子项目,您的问题将得到解决。但是,如果你修复根问题会更好。如果您发布项目结构,parent.pom等,我可以给您一个更详细的答案。