【问题标题】:Weird failure when creating a new Maven project创建新的 Maven 项目时出现奇怪的失败
【发布时间】:2012-11-05 00:00:56
【问题描述】:

我正在使用 Spring Tool Suite(最新版本),每当我执行 New project -> Maven Project 并选择 ma​​ven-archetype-webapp 作为我的原型时,我都会得到我的 pom 文件中出现以下奇怪的错误。

Failure to transfer org.codehaus.plexus:plexus-components:pom:1.1.18 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-components:pom:1.1.18 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

另外,这里是生成的非常简短的 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>Tset</groupId>
    <artifactId>Tset</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Tset 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>
    </dependencies>
    <build>
        <finalName>Tset</finalName>
    </build>
</project>

我是这些方面的新手,所以我可能只是遗漏了一些明显的东西。

我通过从 ROO 生成的新项目中获取 POM 文件解决了这个问题,但我真的很好奇导致这个问题的原因以及如何解决它。

【问题讨论】:

    标签: spring model-view-controller maven spring-roo pom.xml


    【解决方案1】:

    根据我的经验,这种情况有时会发生在 maven 的下载损坏或当 maven 尝试下载此工件或出于任何原因时没有可用的互联网连接时。

    尝试删除 .m2 目录中的工件,例如通过删除文件夹C:\Users\yourname\.m2\repository\org\codehaus\plexus\plexus-components

    【讨论】:

    • 非常感谢您花时间回答! :D
    猜你喜欢
    • 1970-01-01
    • 2016-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 1970-01-01
    • 2022-01-26
    相关资源
    最近更新 更多