我正在使用Selenium 2.44.0和新版TestNG。执行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/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>这是一个错误:
ArtifactTransferException:未能在本地存储库中缓存http://repo.maven.apache.org/maven2中的net.SourceAj.htmlUnit:htmlunit:jar:2.15,在中央更新间隔过去或强制更新之前,不会重新尝试解析。原始错误:无法将工件net.SourceForm.htmlUnit:htmlunit:jar:2.15从/转到中心(http://repo.maven.apache.org/maven2):60000之后没有收到响应
发布于 2017-01-17 15:09:44
在pom.xml中添加下面的依赖项。它起作用了
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.24</version>
</dependency>https://stackoverflow.com/questions/29191848
复制相似问题