Java 传输net.sourceforge.htmlunit失败:htmlunit
我正在使用Selenium 2.44.0和新版本的TestNG。在执行Maven构建之后,发生了一个错误。这是我的Java 传输net.sourceforge.htmlunit失败:htmlunit,java,maven,selenium-webdriver,Java,Maven,Selenium Webdriver,我正在使用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.
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>
4.0.0
STTA
已缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法将工件net.sourceforge.htmlunit:htmlunit:jar:2.15从/传输到中心():60000后未收到响应
在pom.xml中添加以下依赖项。它起作用了
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.24</version>
</dependency>
net.sourceforge.htmlunit
htmlunit
2.24
它只是通知您maven无法访问该位置。尝试手动下载依赖项或使用-U maven标志强制更新。删除maven Repository下的所有.lastupdated文件该消息表示与maven central的连接不起作用。网络问题(如代理服务器后面的问题等)可能是根本原因,应该首先解决。对于上述问题,这不是一个好的解决方案:与Maven Central的连接。强制使用不同版本的依赖项将无法解决连接问题,并且可能会导致用户项目中的额外中断。使用此解决方案问题在我这方面得到了解决@SiKing更好地提供了解决方案