一、运行环境

springboot版本2.3.0

The POM for org.mybatis.spring.boot:mybatisspringbootstarter:jar:1.3.0 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while

building the effective model for org.mybatis.spring.boot:mybatisspringbootstarter:1.3.0

<parent>
   <groupId>org.springframework.boot</groupId>
   &lt;artifactId&gt;spring-boot-starter-parent</artifactId&gt;
   <version&gt;2.3.0.RELEASE</version>
</parent>

mybatis版本1.3.0

<dependency>
   <groupId>org.mybatis.spring.boot</groupId>
   <artifactId>mybatis-spring-boot-starter</artifactId>
   <version>1.3.0</version>
   <optional>true</optional>
</dependency>

二、问题排查

git上拉下来的代码,刚开始是MyBatisConfigurer配置类的两个包导不进来

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;

所以将问题定位mybatis-springboot-starter的包上,怀疑是包损坏了,删除包之后重新下载,仍出现上述情况。排除jar损坏的原因

后来刷新maven仓库时报了下面的警告

[WARNING]The POM org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:1.3.0 for is invalid, transitive dependencies (if any) will not be available

随后我就去csdn查找解决方案,都没有很好的得到解决

最后看到了“兵工厂三剑客”这位博主博客按着他的处理问题流程通过打印maven日志信息

打印日志指令如下

 mvn -X -U clean package

查看日志发现下面报错信息

[WARNING] The POM for org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:1.3.0 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while
 building the effective model for org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.0
[FATAL] Non-parseable POM E:MavenRepositoryorgmybatismybatis-parent28mybatis-parent-28.pom: processing instruction can not have PITarget with reserved xml name (position: END_TA
G seen ...</profiles>rnrn</project>rn<?xml ... @1096:7)  @ E:MavenRepositoryorgmybatismybatis-parent28mybatis-parent-28.pom, line 1096, column 7

注:[FATAL] 这个输出消息等级更加严格译为致命的,是比error等级还要高的异常

附加知识点log4j定义了8个级别log(除去OFF和ALL,可以分为6个级别),优先级从高到低依次为:OFF、FATAL、ERROR、WARN、INFO、DEBUG、TRACE、 ALL。

三、解决方案

最终将问题定位到 E:MavenRepositoryorgmybatismybatis-parent28mybatis-parent-28.pom, line 1096, column 7这个文件

然后根据路径找到该文件删除该文所在的文件夹重启idear,更新maven,问题得到解决

具体到底时详细那个地方造成异常原因,这个我并没找到,期待那位大佬,能够将深层次的的原因描述一下。

原文地址:https://blog.csdn.net/m0_73761022/article/details/128673121

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_25794.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注