无法在spring工具中下载maven依赖项

时间:2015-05-25 08:45:42

标签: java spring maven spring-mvc

这是我的pom.xml文件,当我导入项目时,它在pom.xml文件的顶行显示错误为“无法传输xstream,因为它缓存在本地目录中,分辨率不会重新尝试,直到中心的更新间隔已经过去或强制更新“

我是全新的,请帮助我。

我正在通过JPA和Hibernate的Spring教程学习,但我坚持这个请帮助我,并提前感谢

<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.pluralsight</groupId>
  <artifactId>FitnessTracker</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>FitnessTracker 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>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.2.6.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.1.3.Final</version>
</dependency>

<dependency>
    <groupId>org.codehaus.jackson</groupId>
    <artifactId>jackson-mapper-asl</artifactId>
    <version>1.9.13</version>
</dependency>

<dependency>
    <groupId>com.thoughtworks.xstream</groupId>
    <artifactId>xstream</artifactId>
    <version>1.4.8</version>
</dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-oxm</artifactId>
    <version>3.0.0.RELEASE</version>
</dependency>

  </dependencies>
  <build>
    <finalName>FitnessTracker</finalName>
  </build>
</project>

1 个答案:

答案 0 :(得分:2)

在构建项目时使用-U参数。

mvn clean install -U

如果不起作用,请从当地的maven repo中删除xstream的文件夹并执行

 mvn clean install -U