截至8月2日,我们的Maven构建在Jenkins突然失败。我们无法解释为什么maven failsafe无法访问它依赖的“booter”插件。
有没有人见过同样的事情?
[INFO] [failsafe:integration-test {execution: run-integration-tests}]
[INFO] Failsafe report directory: /var/lib/jenkins/workspace/Foo/integration-tests/target/failsafe-reports
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to locate surefire-booter in the list of plugin artifacts
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.RuntimeException: Unable to locate surefire-booter in the list of plugin artifacts
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getForkConfiguration(AbstractSurefireMojo.java:1152)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:655)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:647)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:606)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:569)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
答案 0 :(得分:5)
问题仅限于Maven Failsafe 2.12.1,其中a directory listing from the Apache repo显示于8月1日晚些时候发布。
解决方法是将您的POM中的版本修复到更早的版本2.12,或者您可能还想尝试更高版本,例如2.12.2或2.12.3(发布此答案的日期)。我没有尝试过这些更高版本,“2.12”是适用于我的版本字符串。
只需添加选择的版本,即在POM中声明插件。
据推测这是有效的,因为只有2.12.1有问题(未确诊,AFAICT)
答案 1 :(得分:2)
我使用Maven 2遇到了这个问题。切换到Maven 3解决了我的问题。另外,Simon增加maven-surefire-plugin的答案与Maven 2一起使用。