Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven error in eclipse (pom.xml) : Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4

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

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

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

I've updated my Maven project but with no results !!

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>
like image 869
AHméd Net Avatar asked Aug 22 '14 12:08

AHméd Net


People also ask

How do I fix POM xml error in eclipse?

Additionally,right click on the pom. xml file in the 'project explorer' > click on 'validate'. This should remove the red-error mark on file, if there are no problems in the XML configuration.

What is surefire plugin in Maven?

The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It generates reports in two different file formats: Plain text files (*. txt) XML files (*.


3 Answers

You need just to follow those steps:

  1. Right Click on your project: Run (As) -> Maven clean
  2. Right Click on your project: Run (As) -> Maven install

After which, if the build fails when you do Maven Install, it means there is no web.xml file under WEB-INF or some problem associated with it. it really works

like image 121
Mohamed NAOUALI Avatar answered Oct 16 '22 17:10

Mohamed NAOUALI


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

like image 12
rahulnikhare Avatar answered Oct 16 '22 18:10

rahulnikhare


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.

like image 3
lilalinux Avatar answered Oct 16 '22 17:10

lilalinux