mvn clean时报错:build.plugins.plugin.version……is missing

1、mvn clean,报错:maven-surefire-plugin is missing,maven-jar-plugin is missing,maven-deploy-plugin is missing
E:\softwareTest\dubbo-master\dubbo-admin>mvn clean
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.alibaba:dubbo-admin:war:2.5.4-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ com.alibaba:dubbo-parent:2.5.4-SNAPSHOT, E:\softwareTest\dubbo-master\pom.xml, line 390, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ com.alibaba:dubbo-parent:2.5.4-SNAPSHOT, E:\softwareTest\dubbo-master\pom.xml, line 376, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ com.alibaba:dubbo-parent:2.5.4-SNAPSHOT, E:\softwareTest\dubbo-master\pom.xml, line 460, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
2、以第一个warning举例:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing.
-------上述说的很清楚,插件maven-surefire-plugin的版本丢失
 @ com.alibaba:dubbo-parent:2.5.4-SNAPSHOT, E:\softwareTest\dubbo-master\pom.xml, line 390, column 12
 ------------------------在 E:\softwareTest\dubbo-master\pom.xml, 第390行

- 2.1打开上述文件,到第390行查看maven-surefire-plugin是没有添加版本信息
在这里插入图片描述
- 2,2 添加版本信息怎样知道插件的版本号呢?
到该地址下:https://mvnrepository.com/artifact/org.apache.maven.plugins
搜索对应的插件名,查看该插件上的版本号,可以用上一次release的版本,eg:
在这里插入图片描述
版本添加后:
在这里插入图片描述
- 2.3 其他的插件:maven-jar-plugin、maven-deploy-plugin 分别添加上版本就ok了

3、再次运行mvn clean就不报错了

猜你喜欢

转载自blog.csdn.net/weixin_39772200/article/details/104231599
mvn