2

从这个页面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

我以这个目标运行测试: clean verify 我认为基本目录设置正确“${workspace_loc:/serenity-demos/jbehave-webtests}”

我该如何解决这个问题?感谢您的任何建议。

4

2 回答 2

3

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

没有可用的 1.1.22 版本。只有 rc 版本可供下载。您可以更改依赖项以使用这些 1.1.22-rc.x jar 之一,也可以升级到 1.1.24 及更高版本。

于 2016-03-21T10:36:39.763 回答
2

当您收到此类错误时,表示由于某种原因未从 MVN 存储库下载 jar,原因可能是版本错误或没有连接等。

尝试在下面共享的链接中的 MVN 存储库中找到正确的版本,如果下载了 jar,还尝试签入 .m2 文件夹

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

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

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

将此添加到您的 POM 中,

里面<dependencies>

或从此处的列表中找到所需的版本

于 2016-03-21T11:19:25.993 回答