2010-05-06 53 views
2

我在使用Spring MVC與Maven開發Web應用程序,但是當我更新我依賴我得到這個消息:春行家錯誤

 
5/6/10 10:09:50 AM CEST: Build errors for amundsen.web; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources (default-resources) on project amundsen.web: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.1 or one of its dependencies could not be resolved: Unable to get dependency information for org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.1: Failed to process POM for org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.1: Non-resolvable parent POM org.apache:apache:6 for org.apache.maven:maven-parent:13: Failed to resolve POM for org.apache:apache:6 due to The repository system is offline and the requested artifact is not locally available at /home/waleed/.m2/repository/org/apache/apache/6/apache-6.pom 
    org.apache:apache:pom:6 

from the specified remote repositories: 
    plexus.snapshots (http://oss.repository.sonatype.org/content/repositories/plexus-snapshots, releases=false, snapshots=true), 
    central (http://repo1.maven.org/maven2, releases=true, snapshots=false) 

我的Maven依賴是:

<!-- Junit --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>${junit.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>cglib</groupId> 
     <artifactId>cglib</artifactId> 
     <version>2.2</version> 
    </dependency> 
    <dependency> 
     <groupId>commons-lang</groupId> 
     <artifactId>commons-lang</artifactId> 
     <version>2.3</version> 
    </dependency> 

     <dependency> <groupId>javax.servlet</groupId> 
     <artifactId>com.springsource.javax.servlet.jsp.jstl</artifactId> 
     <version>${servlet.jstl.version}</version> </dependency> 

    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>${servlet-api.version}</version> 
    </dependency> 

    <!--<dependency> 
     <groupId>jstl</groupId> 
     <artifactId>jstl</artifactId> 
     <version>${jstl.version}</version> 
    </dependency> 

    --><!--<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
    </dependency> 

    --><dependency> 
     <groupId>org.apache.taglibs</groupId> 
     <artifactId>com.springsource.org.apache.taglibs.standard</artifactId> 
     <version>${standard-taglib.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-aspects</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 



    <!-- 
     <dependency> <groupId>org.springframework</groupId> 
     <artifactId>spring-beans</artifactId> 
     <version>${spring.version}</version> </dependency> 
    --> 

    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>com.springsource.org.apache.commons.collections</artifactId> 
    </dependency> 
    <!-- Compile dependencies --> 
    <dependency> 
     <groupId>org.apache.log4j</groupId> 
     <artifactId>com.springsource.org.apache.log4j</artifactId> 
    </dependency> 
    <!-- Spring (3.0) --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.core</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.aop</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.expression</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.context</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.context.support</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.beans</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.orm</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.transaction</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
    </dependency> 

    <!-- Spring security --> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-core</artifactId> 
     <exclusions> 
      <exclusion> 
       <artifactId>spring-aop</artifactId> 
       <groupId>org.springframework</groupId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-core-tiger</artifactId> 
     <version>${spring-security-core-tiger.version}</version> 
     <exclusions> 
      <!-- Exclude 2.0.x spring dependencies --> 
      <exclusion> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-support</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-config</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-acl</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-taglibs</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>commons-dbcp</groupId> 
     <artifactId>commons-dbcp</artifactId> 
     <version>${commons-dbc.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>3.3.1.GA</version> 
    </dependency> 


    <!-- 
     <dependency> <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> 
     hibernate-dependencies is a pom, not needed for hibernate-core 
     </dependency> 
    --> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-annotations</artifactId> 
     <version>3.4.0.GA</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-validator</artifactId> 
     <version>3.1.0.GA</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-commons-annotations</artifactId> 
     <version>3.3.0.ga</version> 
     <exclusions> 
      <exclusion> 
       <groupId>org.hibernate</groupId> 
       <artifactId>hibernate</artifactId> 
      </exclusion> 
     </exclusions> 

    </dependency> 
    <dependency> 
     <groupId>hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
     <version>3.4.0.GA</version> 
    </dependency> 

    <dependency> 
     <groupId>hibernate</groupId> 
     <artifactId>hibernate-tools</artifactId> 
     <version>3.2.3.GA</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>ejb3-persistence</artifactId> 
     <version>1.0.2.GA</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-collections</groupId> 
     <artifactId>commons-collections</artifactId> 
     <version>3.2.1</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.transaction</groupId> 
     <artifactId>jta</artifactId> 
     <version>${jta.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>antlr</groupId> 
     <artifactId>antlr</artifactId> 
     <version>${antlr.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>${mysql-connector-java.version}</version> 
    </dependency> 
    <!-- 


     <dependency> <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> <version>1.5.6</version> 
     </dependency> 
    --><!-- concrete Log4J Implementation for SLF4J API--> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>1.5.6</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.mail</groupId> 
     <artifactId>mail</artifactId> 
     <version>1.4</version> 
    </dependency> 


    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>1.5.11</version> 
    </dependency> 
</dependencies> 

有什麼想法?

+0

是否定義你的父POM一個dependencyManagement?你使用哪個版本庫? (快照?) – khmarbaise 2010-05-06 08:50:25

+0

你解決了你的問題嗎?我在這裏面對同樣的情況! – 2010-12-20 12:32:23

回答

1

由於您的某個依賴關係,構建不會失敗,因爲maven-resources-plugin的某個依賴關係而失敗。更確切地說,Maven是不能夠解決org.apache:apache:pom:6爲中心提供雖然:

http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom

是否使用m2eclipse的?它是否配置爲離線運行(跟蹤似乎表明)?或者這可能與MNGECLIPSE-1802有關?

嘗試在命令行上運行maven,它應該可以工作,並且可以解決m2eclipse的問題。

0

Maven無法解析org.apache:apache:pom:6,因爲它離線工作。 在脫機模式下工作時,不在本地存儲庫中的依賴項將無法訪問。

嘗試從命令提示符下運行Maven,並檢查當前配置