maven建议: 从2.53.0开始,您需要明确包含HtmlUnitDriver作为包含它的依赖项。
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.20</version>
</dependency>
但是,构建无法解决依赖关系。
&GT;
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.648 s
[INFO] Finished at: 2016-03-24T14:49:18+02:00
[INFO] Final Memory: 7M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project maven_selenium_project_sample: Could not resolve dependencies for project com.samplecompany:maven_selenium_project_sample:jar:1.0-SNAPSHOT: Could not find artifact org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.20 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project maven_selenium_project_sample: Could not resolve dependencies for project com.samplecompany:maven_selenium_project_sample:jar:1.0-SNAPSHOT: Could not find artifact org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.20 in central (https://repo.maven.apache.org/maven2)
我错过了什么?
由于
答案 0 :(得分:1)
你错过了0
这样的版本:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.20.0</version>
</dependency>
答案 1 :(得分:-1)
根据错误:Maven Central不存在您要求的内容。你需要:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.20</version>
</dependency>
或:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.52.0</version>
</dependency>
或here中的其他可能版本之一。