简体   繁体   English

缺少神器 io.github.bonigarcia:webdrivermanager

[英]Missing artifact io.github.bonigarcia:webdrivermanager

I have created one maven project and added webdrivermager from bonigarcia in the pom.xml.我创建了一个 maven 项目,并在 pom.xml 中添加了来自 bonigarcia 的 webdrivermager。 It is giving me the error missing artifact io.github.bonigarcia:webdrivermanager.它给我错误missing artifact io.github.bonigarcia:webdrivermanager。

I tried cleaning the.m2 folder and then downloading all the dependencies again.我尝试清理 .m2 文件夹,然后再次下载所有依赖项。 But the webdrivermanager dependency is not getting added.但是没有添加 webdrivermanager 依赖项。 Below is my pom.xml file.下面是我的 pom.xml 文件。 I also tried changing the versions.我也尝试更改版本。

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>SeleniumFramework</groupId>
  <artifactId>SeleniumFramework</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
 <dependencies>
   <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.141.59</version>
  </dependency>

  <!-- https://mvnrepository.com/artifact/junit/junit -->
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
  </dependency> 

  <!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
  <dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>3.8.1</version>
    <scope>test</scope>
  </dependency> 
</dependencies>
</project>

and below is my source code下面是我的源代码

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

public class BrowserTest {
    public static void main(String[] args) {
        WebDriverManager.firefoxdriver().setup();
        WebDriver driver= new FirefoxDriver();
        driver.get("https://selenium.dev/");
        driver.quit();  
    }   
}

I'm getting this error after doing a maven install [![enter image description here][1]][1]我在执行maven 安装[![在此处输入图像描述][1]][1] 后收到此错误

More description of the error:错误的更多描述:

*[WARNING] The POM for io.github.bonigarcia:webdrivermanager:jar:3.8.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.563 s
[INFO] Finished at: 2020-02-05T11:56:49+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SeleniumFramework: Could not resolve dependencies for project SeleniumFramework:SeleniumFramework:jar:0.0.1-SNAPSHOT: Failure to find io.github.bonigarcia:webdrivermanager:jar:3.8.1 in <one of the url> was cached in the local repository, resolution will not be reattempted until the update interval of repository has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.*

This issue is solved now as we have to add the URL of the global maven repository in the settings.xml file.这个问题现在已经解决了,因为我们必须在 settings.xml 文件中添加全局maven存储库的 URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM