1

I am getting following error message in pom.xml file, anyone please help me to solve this problem. I have searched the solution in google yet to get solution.

ERROR

Failure to transfer com.thoughtworks.xstream:xstream:pom:1.3.1 from https://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 com.thoughtworks.xstream:xstream:pom:1.3.1 from/to 
 central (https://repo.maven.apache.org/maven2): The operation was cancelled.

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.maven</groupId>
  <artifactId>helloworld</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>helloworld 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>helloworld</finalName>
  </build>
</project>
karthik selvaraj
  • 426
  • 5
  • 12

2 Answers2

0

I fixed this issue by deleting the corresponding failed to download artifact directory in my local repo. So that next time it will downloaded automatically.

karthik selvaraj
  • 426
  • 5
  • 12
0

Let me explain the problem in layman terms

  1. one of the dependencies in the pom.xml is unable to be downloaded.
  2. that's the reason it keeps on showing error whatever you try.
  3. the solution is, identify the dependency and remove it from the pom.xml
  4. Add it as a Jar file (if the dependency is mandatory, else just ignore the dependency)
  5. tricky part is, you have to identify the correct dependency which shows the error. Hope this helps. ps: I am a noobie, I faced the similar issue and the above was the solution which worked for me. Thanks!