我在maven中遇到问题下载selenium 3.0依赖。显示以下错误
C:\ Users \ YNT> mvn依赖项:解析[INFO]扫描项目... 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -clean-plugin / 2.5 / maven-clean-plugin-2.5.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- clean-plugin / 2.5 / maven-clean-plugin-2.5.pom(4 KB,0.8 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -plugins / 22 / maven-plugins-22.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- plugins / 22 / maven-plugins-22.pom(13 KB,10.3 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -install-plugin / 2.4 / maven-install-plugin-2.4.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- install-plugin / 2.4 / maven-install-plugin-2.4.pom(7 KB,7.8 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -deploy-plugin / 2.7 / maven-deploy-plugin-2.7.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- deploy-plugin / 2.7 / maven-deploy-plugin-2.7.pom(6 KB,5.5 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -site-plugin / 3.3 / maven-site-plugin-3.3.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- site-plugin / 3.3 / maven-site-plugin-3.3.pom(21 KB,20.6 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -antrun-plugin / 1.3 / maven-antrun-plugin-1.3.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- antrun-plugin / 1.3 / maven-antrun-plugin-1.3.pom(5 KB,4.5 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -plugins / 12 / maven-plugins-12.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- plugins / 12 / maven-plugins-12.pom(12 KB,11.4 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/ 9 / maven-parent-9.pom已下载: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/9 /maven-parent-9.pom(33 KB,31.3 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -antrun-plugin / 1.3 / maven-antrun-plugin-1.3.jar已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- antrun-plugin / 1.3 / maven-antrun-plugin-1.3.jar(24 KB,23.7 KB /秒) 下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -assembly-plugin / 2.2-beta-5 / maven-assembly-plugin-2.2-beta-5.pom已下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- assembly-plugin / 2.2-beta-5 / maven-assembly-plugin-2.2-beta-5.pom(15 KB 以16.4 K B /秒的速度下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -plugins / 16 / maven-plugins-16.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- plugins / 16 / maven-plugins-16.pom(13 KB,12.6 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/ 15 / maven-parent-15.pom已下载: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/1 5 / maven-parent-15.pom(24 KB,28.6 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.p om 下载: https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.po m (13 KB,15.3 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -assembly-plugin / 2.2-beta-5 / maven-assembly-plugin-2.2-beta-5.jar已下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- assembly-plugin / 2.2-beta-5 / maven-assembly-plugin-2.2-beta-5.jar(204 KB为85.2 KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -dependency-plugin / 2.8 / maven-dependency-plugin-2.8.pom已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- dependency-plugin / 2.8 / maven-dependency-plugin-2.8.pom(12 KB,12 KB KB /秒)下载: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven -dependency-plugin / 2.8 / maven-dependency-plugin-2.8.jar已下载:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- dependency-plugin / 2.8 / maven-dependency-plugin-2.8.jar(150 KB,82.7 KB /秒)[INFO] [INFO] -------------------------------------------------- ---------------------- [INFO]建设Maven Stub项目(无POM)1 [INFO] -------------------------------------------------- ---------------------- [INFO] -------------------------------------------------- ---------------------- [INFO] BUILD FAILURE [INFO] -------------------------------------------------- ---------------------- [INFO]总时间:22.959秒[INFO]完成于: 2016-10-16T16:20:11 + 05:30 [信息]最终记忆:12M / 115M [INFO] -------------------------------------------------- ---------------------- [错误]无法执行目标 org.apache.maven.plugins:Maven的依赖关系的插件: 2.8:resolve(default-cli):目标需要项目执行但该目录中没有PO M(C:\ Users \ YNT)。请验证你 从correct目录调用Maven。 - > [帮助1] [错误] [错误] 要查看错误的完整堆栈跟踪,请使用-e重新运行Maven swit ch。 [ERROR]使用-X开关重新运行Maven以启用完全调试 日志记录。 [错误] [错误]有关错误和更多信息 可能的解决方案,请阅读以下文章:[错误] [帮助 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject 例外
以下是在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>Talentrack</groupId>
<artifactId>Talentrack_talent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.0</version>
</dependency>
</project>
我是采用正确的方法还是犯了一些错误。
答案 0 :(得分:1)
您的pom.xml看起来不对,所有依赖项都应该在依赖项标记
中