Maven无法解决项目的依赖关系

时间:2016-03-21 10:16:48

标签: maven maven-3 serenity-bdd

从这个页面https://github.com/serenity-bdd/serenity-demos我下载了我导入到eclipse的文件。我试图从" jbehave-webtests"运行测试。项目。在运行这些测试期间,我收到了以下错误:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Sample Serenity JBehave project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for net.serenity-bdd:serenity-core:jar:1.1.22-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for net.serenity-bdd:serenity-rest-assured:jar:1.1.22-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for net.serenity-bdd:serenity-jbehave:jar:1.2.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.690 s
[INFO] Finished at: 2016-03-21T10:33:24+01:00
[INFO] Final Memory: 7M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project serenity-jbehave-showcase: Could not resolve dependencies for project net.serenitybdd.showcase:serenity-jbehave-showcase:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: net.serenity-bdd:serenity-core:jar:1.1.22-SNAPSHOT, net.serenity-bdd:serenity-rest-assured:jar:1.1.22-SNAPSHOT, net.serenity-bdd:serenity-jbehave:jar:1.2.1-SNAPSHOT: Could not find artifact net.serenity-bdd:serenity-core:jar:1.1.22-SNAPSHOT -> [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.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我以此目标运行测试:清除验证 我认为基本目录已正确设置" $ {workspace_loc:/ serenity-demos / jbehave-webtests}"

如何解决此问题?谢谢你的任何建议。

2 个答案:

答案 0 :(得分:2)

当你收到这样的错误时,这意味着由于某些原因,没有从MVN repo下载jar, 原因可能是错误的版本或没有连接等。

尝试在下面的链接共享中找到MVN repo中的正确版本,并尝试在下载jar时检入.m2文件夹

如果创建了.lastupdated扩展名,maven有时会无法下载jar文件。确保在更新前删除该文件。

永远不要在不解析所有依赖项的情况下构建项目。

<dependency>
    <groupId>net.serenity-bdd</groupId>
    <artifactId>serenity-rest-assured</artifactId>
    <version>1.1.21</version>
</dependency>

在POM中添加此内容,

内部<dependencies>

或从列表here

中找到所需的版本

答案 1 :(得分:1)

正如您在maven存储库中看到的那样:serenity-bdd

没有1.1.22版本。只有rc版本可供下载。您可以更改依赖项以使用其中一个1.1.22-rc.x jar或者您可以升级到1.1.24及更高版本的系列。