接个吻. 2022-11-07 05:16 采纳率: 93.1%
浏览 31
已结题

springboot多模块开发的web模块无法使用batis模块

问题遇到的现象和发生背景

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.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
</parent>

<dependencies>

      <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
      </dependency>

      <dependency>
            <groupId>com.smile.hd</groupId>
            <artifactId>batis</artifactId>
            <version>1.0-SNAPSHOT</version>
      </dependency>

      
      <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.2</version>
      </dependency>

      <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
      </dependency>

      
      <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.30</version>
      </dependency>

</dependencies>

<modules>
     <module>client</module>
     <module>management</module>
     <module>batis</module>
</modules>

web模块pom.xml

<dependencies>
      <dependency>
            <groupId>com.smile.hd</groupId>
            <artifactId>batis</artifactId>
            <version>1.0-SNAPSHOT</version>
      </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。

  • 写回答

3条回答 默认 最新

  • CSDN专家-sinJack 2022-11-07 07:49
    关注

    报错是数据库问题,跟引入的batis无关系。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 11月15日
  • 已采纳回答 11月7日
  • 创建了问题 11月7日

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分