Maven failsafe plugin fails with “Unable to locate surefire-booter”

怎甘沉沦 提交于 2019-12-10 19:09:41

问题


Our Maven build is suddenly failing in Jenkins as of August 2nd. We cannot explain why maven failsafe cannot access it's dependent "booter" plugin.

Has anyone seen the same thing?

[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)

回答1:


The problem is confined to Maven Failsafe 2.12.1 which a directory listing from the Apache repo shows was released late on August 1st.

The workaround is to fix your version in your POM to the earier 2.12 or you might also want to try later versions such as 2.12.2 or 2.12.3 (which post date this answer). I have not tried these later versions and "2.12" is the version string that worked for me.

Just add chosen version where the plugin is declared in the POM.

Presumably this works because only 2.12.1 has the problem (which is undiagnosed, AFAICT)




回答2:


I ran into this problem using Maven 2. Switching to Maven 3 resolved my issue. Also Simon's answer of incrementing the maven-surefire-plugin worked with Maven 2.



来源:https://stackoverflow.com/questions/11793200/maven-failsafe-plugin-fails-with-unable-to-locate-surefire-booter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!