zoukankan      html  css  js  c++  java
  • 利用Eclipse中的Maven构建Web项目报错(一)

    利用Eclipse中的Maven构建Web项目


    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>
      <groupId>com.you.maven</groupId>
      <artifactId>maven-you-web</artifactId>
      <packaging>war</packaging>
      <version>0.0.1-SNAPSHOT</version>
      <name>maven-you-web Maven Webapp</name>
      <url>http://maven.apache.org</url>
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>br.gov.frameworkdemoiselle.archetypes</groupId>
        	<artifactId>demoiselle-jsf-jpa</artifactId>
        	<version>2.4.0</version>
        </dependency>
        <dependency>
        	<groupId>jstl</groupId>
        	<artifactId>jstl</artifactId>
        	<version>1.2</version>
        </dependency>
        <dependency>
        	<groupId>org.codehaus.plexus</groupId>
        	<artifactId>plexus-archiver</artifactId>
        	<version>2.4.4</version>
        </dependency>
      </dependencies>
      <build>
        <finalName>maven-you-web</finalName>
      </build>
    </project>
    

    2、错误描述

    Failure to transfer org.codehaus.plexus:plexus-archiver:jar:1.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of 
     central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-archiver:jar:1.2 from/to central (http://repo.maven.apache.org/maven2): connection timed 
     out to http://220.231.231.15/download/13282160/36221368/3/jar/84/9/1379427315796_265/plexus-archiver-1.2.jar

    3、解决办法

    (1)先去掉Maven工程的maven特性,选中工程 鼠标右键-->Maven-->Disable Maven Nature



    (2)为工程增加Maven特性,选中工程 鼠标右键-->Configure-->Convert to Maven Project


  • 相关阅读:
    【MongoDB初识】-结合C#简单使用,驱动2.x
    【NuGet】打包上传一条龙服务
    【NuGet】搭建自己团队或公司的NuGet
    【MongoDB初识】-其他操作
    【MongoDB初识】-条件操作符
    【MongoDB初识】-增删改
    【MongoDB初识】-安装篇
    【面试题】-100盏灯
    【微信开发】一获取用户授权(静默授权方式)
    XML序列化及反序列化
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315090.html
Copyright © 2011-2022 走看看