maven warnning 'build.plugins.plugin.version' is missing

裝完maven后,package或clean时出错:
[WARN]
[WARN] Some problems were encountered while building the effective model 
 [WARN] 'build.plugins.plugin.version' is missing fororg.apache.maven.plugins:maven.compiler.plugin
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.

org.apache.maven.plugins:maven.compiler.plugin是一个plugin。可以通过“Add Denpendency”来添加。

在pom.xml中添加新的dependency:

 <dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<type>maven-plugin</type>
</dependency>
在build中添加:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

但是仍然有个错误,错误信息:build.plugins.plugin.version
可以看到,在pom.xml里面的<build>下面,沒有<version>。因此要多加一个version:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

好,解决问题。
————————————————
版权声明:本文为CSDN博主「白杨树」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hongchangfirst/article/details/7527063

 

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.1.2</version>
</dependency>

https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin/3.1.2

 

posted @   沧海一滴  阅读(13368)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
历史上的今天:
2018-09-05 HATEOAS REST Service
2018-09-05 谈谈封装和抽象的区别
2018-09-05 java命令--jstack 工具
2018-09-05 详述 hosts 文件的作用及修改 hosts 文件的方法
2016-09-05 mybatis insertUseGeneratedKeys
2016-09-05 Configure swagger with spring boot
2016-09-05 Spring Boot集成Jasypt安全框架
点击右上角即可分享
微信分享提示