maven 打包报错 Failed to execute goal org.apache.maven.plugins:

587 阅读1分钟

文章已参与[新人创作礼]活动,一起开启掘金创作之路.

微信公众号:秀基宝。如有问题,请后台留言,反正我也不会听。

 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project iandyou-security: There are test failures.\
[ERROR] \
[ERROR] Please refer to /Volumes/MXY/work/danger/idreamyou/iandyou-server/iandyou-security/target/surefire-reports for the individual test results.\
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.\
[ERROR] There was an error in the forked process\
[ERROR] java.lang.ClassNotFoundException: org.apache.maven.surefire.junit4.JUnit4Provider\
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process\
[ERROR] java.lang.ClassNotFoundException: org.apache.maven.surefire.junit4.JUnit4Provider\
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656)\
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)\
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)\
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)\
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)\
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)\
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)\
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)\
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)\
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)\
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)\
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)\
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)\
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)\
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)\
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)\
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)\
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)\
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)\
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)\
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)\
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)\
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)\
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)\
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)\
[ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47)\
[ERROR] -> [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/MojoExecutionException\
[ERROR] \
[ERROR] After correcting the problems, you can resume the build with the command\
[ERROR]   mvn <goals> -rf :iandyou-security

![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0cd89e378f3e434eb74a0365bb9f7259~tplv-k3u1fbpfcp-zoom-1.image)![](<> "点击并拖拽以移动")​

上面可以看得到有关于test的报错,所以你如果发现test模块有文件请删除,或者添加test架包

本人开发的玩基金小工具

个人博客:
名称:纯洁的麦田
链接:[http://www.idearyou.cn/](https://www.idearyou.cn/ "http://www.idearyou.cn/")\
描述:争取哪一天做上架构师
公众号:纯洁的麦田

网址:[www.idearyou.cn]
谷歌插件搜:秀基宝
小程序:秀基宝
复制代码
复制代码

后语 如果本文对你哪怕有一丁点帮助,请帮忙点好看。你的好看是我坚持写作的动力。 另外,关注免费学习。