eclipse 创建spring boot项目以及出现警告:pom.xml不存在的解决办法

Step 1: File=>New=>Project=>Spring Starter Project
 
Step 2: 填写项目基本信息
 
Step 3:选择需要引用的功能包
此处选择Lombok与Spring Data JPA
 
Step 4:项目创建完,基本结构如下:
 
此处pom.xml前面有个错误。
右键项目=>Run as maven build出现如下错误信息
右键项目=>Maven=>Update Project
[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
 
解决办法: 参考原文链接:https://blog.csdn.net/hills/article/details/118525257
因为eclipse插件不兼容的原因,加上当前spring boot工程默认是jar导出,所以需要在你的pom.xml加上以下配置项:
<properties>
    <maven-jar-plugin.version>3.0.0</maven-jar-plugin.version>
</properties>
 
上述代码中“3.0.0”需要你以实际的版本号为准。
最后,右键项目=>Maven=>Update Project...后,此报错消失。
 
这个插件的作用是,比如:利用maven打jar时,设定manifest的参数,比如指定运行的Main class入口类,以及将依赖的jar包加入到classpath中等。
posted @ 2022-08-15 13:59  Joan2016  阅读(924)  评论(0编辑  收藏  举报