异常在线程 “main” java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver
2022-09-04 03:20:35
我已经在我的pom中添加了最新的硒依赖性.xml
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.7.1</version>
</dependency>
我用我的pom在目录中运行了mvn干净安装.xml并且我还根据Selenium文档在我的应用程序类中导入了正确的类
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
但是,当我尝试运行我的主方法时,我得到以下错误
Exception in thread "main" java.lang.NoClassDefFoundError:
org/openqa/selenium/WebDriver
我查看我的~/.m2/repository文件夹,我没有看到openqa文件夹,而是看到一个seleniumhq文件夹。
为什么 maven 没有安装 openqa 文件夹,为什么文档说要从 org.openqa 导入...当它从未存在于我的jar存储库中时。我非常困惑,我只是希望能够成功地导入硒Webdriver,同时将其放在我的本地存储库中。