Search code examples
springmodel-view-controllermavenspring-roopom.xml

Weird failure when creating a new Maven project


I'm using Spring Tool Suite (latest version) and whenever I do New project -> Maven Project and choose maven-archetype-webapp as my archetype I get the following weird error in my pom file.

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

Also, here's the very short and simple generated pom.xml file

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

I'm a newbie at these, so I might just be missing something obvious.

I solved it by getting a POM file from a ROO-generated new project, but I'm really curious about what causes this and how I could solve it.


Solution

  • In my experience this happens sometimes when a download by maven was corrupt or if no internet connection was available when maven tried to download this artefact or for whatever reason.

    Try to delete the artifact in your .m2 directory, e.g. by deleting the folder C:\Users\yourname\.m2\repository\org\codehaus\plexus\plexus-components.