eclipse中的Maven错误(pom.xml):无法传输org.apache.maven.plugins:maven-surefire插件:pom:2.12.4。

时间:2022-07-11 17:17:34

i wanna make web project using the Maven to import automatically all libraries that i need, so i chose "maven-archetype-webpp"

我想让web项目使用Maven自动导入我需要的所有库,所以我选择了“Maven - prototype -webpp”

after that i got this error on pom.xml file :

之后我在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

im updated my Maven project but with no results !!

我更新了我的Maven项目,但是没有结果!

POM.XML :

砰的一声。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>

4 个解决方案

#1


44  

You need just to follow those steps:

你只需要遵循以下步骤:

  1. Right Click on your project: Run (As) -> Maven clean
  2. 右键单击项目:Run (As) -> Maven clean
  3. Right Click on your project: Run (As) -> Maven install
  4. 右键单击项目:Run (As) -> Maven安装

#2


2  

Right click on project-> Maven->Click checked box 'Force Update'->Update

右键点击项目-> Maven->点击复选框“Force Update”->更新

#3


1  

just right click on your project, hover maven then click update project.. done!!

只需右键单击您的项目,悬停maven,然后单击update project。完成了! !

#4


1  

In my case it was a failed import to eclipse. I had to delete the project from eclipse (without deleting form the filesystem of course) and reimport it. After that the error was gone immediately.

在我的例子中,它是eclipse的失败导入。我必须从eclipse中删除这个项目(当然不需要从文件系统中删除)并重新导入它。在那之后,错误立刻消失了。

#1


44  

You need just to follow those steps:

你只需要遵循以下步骤:

  1. Right Click on your project: Run (As) -> Maven clean
  2. 右键单击项目:Run (As) -> Maven clean
  3. Right Click on your project: Run (As) -> Maven install
  4. 右键单击项目:Run (As) -> Maven安装

#2


2  

Right click on project-> Maven->Click checked box 'Force Update'->Update

右键点击项目-> Maven->点击复选框“Force Update”->更新

#3


1  

just right click on your project, hover maven then click update project.. done!!

只需右键单击您的项目,悬停maven,然后单击update project。完成了! !

#4


1  

In my case it was a failed import to eclipse. I had to delete the project from eclipse (without deleting form the filesystem of course) and reimport it. After that the error was gone immediately.

在我的例子中,它是eclipse的失败导入。我必须从eclipse中删除这个项目(当然不需要从文件系统中删除)并重新导入它。在那之后,错误立刻消失了。