当前位置:首页 > 服务端 > maven编译maven-surefire-plugin插件报错

maven编译maven-surefire-plugin插件报错

 

1、编译错误信息:

60 [INFO] ------------------------------------------------------------------------
61 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project wbsbPubFunc: Unable to generate classpath: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
62 [ERROR] ----------
63 [ERROR] 1) org.apache.maven.surefire:surefire-junit4:jar:2.12.4
64 [ERROR] 
65 [ERROR] Try downloading the file manually from the project website.
66 [ERROR] 
67 [ERROR] Then, install it using the command:
68 [ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit4 -Dversion=2.12.4 -Dpackaging=jar -Dfile=/path/to/file
69 [ERROR] 
70 [ERROR] Alternatively, if you host your own repository you can deploy the file there:
71 [ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit4 -Dversion=2.12.4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
72 [ERROR] 
73 [ERROR] Path to dependency:
74 [ERROR] 1) dummy:dummy:jar:1.0
75 [ERROR] 2) org.apache.maven.surefire:surefire-junit4:jar:2.12.4
76 [ERROR] 
77 [ERROR] ----------
78 [ERROR] 1 required artifact is missing.
79 [ERROR] 
80 [ERROR] for artifact:
81 [ERROR] dummy:dummy:jar:1.0
82 [ERROR] 
83 [ERROR] from the specified remote repositories:
84 [ERROR] alimaven (http://maven.aliyun.com/nexus/content/groups/public/, releases=true, snapshots=false)
85 [ERROR] -> [Help 1]
86 [ERROR] 
87 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
88 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
89 [ERROR] 
90 [ERROR] For more information about the errors and possible solutions, please read the following articles:
91 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
92 [ERROR] 
93 [ERROR] After correcting the problems, you can resume the build with the command
94 [ERROR]   mvn <goals> -rf :PubFunc

解决办法:

在pom.xml中加过滤条件

1           <plugin>
2                   <artifactId>maven-surefire-plugin</artifactId>
3                   <version>2.12.4</version>
4                  <configuration>
5                     <skipTests>true</skipTests>
6                 </configuration>
7                 </plugin>

 

2、jre版本不对,错误信息:

1 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wbsbAppIntf: Compilation failure
2 [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
3 [ERROR] -> [Help 1]
4 [ERROR] 
5 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
6 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
7 [ERROR] 

解决办法:把项目的jre配置改成自己本地的,不用默认设置的jre

maven编译maven-surefire-plugin插件报错 _ JavaClub全栈架构师技术笔记

maven编译maven-surefire-plugin插件报错 _ JavaClub全栈架构师技术笔记

 具体可以看这篇:

https://www.cnblogs.com/qyf404/p/5013694.html

作者:柠檬味的橘子皮
来源链接:https://www.cnblogs.com/lifuhei/p/10394624.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/124606.html

标签: No compiler
分享给朋友: