我想使用Maven自动导入我需要的所有库,所以我选择了"maven-archetype-webpp"
在此之后,我得到了pom.xml文件上的错误:
Description Resource Path Location Type Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 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.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /SpringTuto line 1 Maven Configuration Problem我更新了我的Maven项目,但是没有结果!!
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.pre.example</groupId>
<artifactId>SpringTuto</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>SpringTuto 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>SpringTuto</finalName>
</build>
</project>发布于 2015-11-17 16:26:46
你只需遵循以下步骤:
在此之后,如果在执行Maven安装时构建失败,这意味着web.xml下没有web.xml文件或与其相关的一些问题。它真的很管用
发布于 2018-02-11 04:03:19
右键单击项目->Maven->单击复选框'Force‘>更新
发布于 2018-04-19 17:10:02
在我的例子中,它是eclipse的一个失败的导入。我不得不从eclipse中删除项目(当然不删除文件系统中的项目)并重新导入它。在那之后,错误立即消失了。
https://stackoverflow.com/questions/25447590
复制相似问题