1

I am using Selenium 2.44.0 and new version of TestNG. After executing a Maven build, an error is happening. This is my 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>STTA</groupId>
  <artifactId>MavenProject</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>MavenProject</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>2.44.0</version>
    </dependency>  
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.8.8</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

This is the error:

ArtifactTransferException: Failure to transfer net.sourceforge.htmlunit:htmlunit:jar:2.15 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 net.sourceforge.htmlunit:htmlunit:jar:2.15 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

2
  • 1
    It's simply informing you that the location is not reachable by maven. Try downloading the dependency by hand or use the -U maven flag to force update. Delete all your .lastupdated file under your maven repository
    – abarisone
    Mar 22, 2015 at 7:38
  • 1
    The message says the connection to Maven central does not work. Network issues like behind a proxy etc. could be root cause which should be fixed first.
    – khmarbaise
    Mar 22, 2015 at 8:30

1 Answer 1

-1

add below dependency in pom.xml. It works

<dependency>
            <groupId>net.sourceforge.htmlunit</groupId>
            <artifactId>htmlunit</artifactId>
            <version>2.24</version>
</dependency>
2
  • This is not a good solution for the above problem: connectivity to Maven Central. Forcing a different version of a dependency will not solve the connectivity problem, and could cause additional breakage in the user's project.
    – SiKing
    Jan 17, 2017 at 18:04
  • Using this solution problem is solved at my end. @SiKing better provide the solution
    – Samir 007
    Jan 18, 2017 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.