springboot多模块开发的web模块无法使用batis模块,构造依赖时就报无法解析 mysql:mysql-connector-java:pom:8.0.31 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt.
主项目pom.xml
<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>2.7.5version>
parent>
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-webartifactId>
dependency>
<dependency>
<groupId>com.smile.hdgroupId>
<artifactId>batisartifactId>
<version>1.0-SNAPSHOTversion>
dependency>
<dependency>
<groupId>com.baomidougroupId>
<artifactId>mybatis-plus-boot-starterartifactId>
<version>3.5.2version>
dependency>
<dependency>
<groupId>org.projectlombokgroupId>
<artifactId>lombokartifactId>
<optional>trueoptional>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
<version>8.0.30version>
dependency>
dependencies>
<modules>
<module>clientmodule>
<module>managementmodule>
<module>batismodule>
modules>
web模块pom.xml
<dependencies>
<dependency>
<groupId>com.smile.hdgroupId>
<artifactId>batisartifactId>
<version>1.0-SNAPSHOTversion>
dependency>
dependencies>
batis模块pom.xml没有自定义任何东西,数据库和mybatis-plus继承了主pom.xml的
无法解析 mysql:mysql-connector-java:pom:8.0.31 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact mysql:mysql-connector-java:pom:8.0.31 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.31/mysql-connector-java-8.0.31.pom
目前没有思路,没有分batis模块时我在web模块里面直接写batis是没问题的,但分一个专门创batis的模块出来依赖的时候就不行了。
我有两个模块,一个是用户端的web模块,一个是管理端的web模块,两个web模块设置了不一样的端口,这两个模块我想让他们都可以用同一个batis。
报错是数据库问题,跟引入的batis无关系。
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!将本地maven仓库中的mysql包删除,重新从中央仓库下载jar包。以前可能是网络或者什么原因。