编译mybatis 3.4.6 替换到springboot 2.0.2
2018-08-01 15:53
633 查看
编译mybatis需要先编译一个mybatis的parent项目(对应的spring boot 2.0.2的mybatis-spring-boot-starter的mybatis版本)
本文举例为mybatis 3.4.6(本文当前的springboot 依赖3.4.6 可以在idea安装插件maven helper查看到)
查看pom发现 3.4.6需要parent的29 所以git下载后直接切换到tag 29先编译parent
编译完成后自动就安装到本地了 接下来直接编译mybatis就行了
这里要注意 编译生成的jar包最好改个名字不要和原版的一样方便区分和调试
然后修改springboot的pom后 使用以上代码 排除原版的mybatis的jar包 换上我们自己的snapshot 的 jar就行了
本文举例为mybatis 3.4.6(本文当前的springboot 依赖3.4.6 可以在idea安装插件maven helper查看到)
查看pom发现 3.4.6需要parent的29 所以git下载后直接切换到tag 29先编译parent
编译完成后自动就安装到本地了 接下来直接编译mybatis就行了
#新建一个目录 git clone https://github.com/mybatis/parent.git cd parent git checkout mybatis-parent-29 # 先编译parent 直接mvn install 就会安装到本地库中 mvn install cd .. git clone https://github.com/mybatis/mybatis-3.git cd mybatis-3 git checkout mybatis-3.4.6 cd .. # 再切换到 mybatis目录中 mvn clean mvn install -DskipTests=true -Dmaven.test.skip=true -Dlicense.skip=true # 修改 mybatis的 pom.xml 增加一个-snapshot 就可以在本地生成自己的mybatis 3.4.6-snapshot的jar包 # <artifactId>mybatis</artifactId> # <version>3.4.6-snapshot</version> # <packaging>jar</packaging> 然后如下修改springboot的pom.xml文件 就能使用自己的mybatis了
这里要注意 编译生成的jar包最好改个名字不要和原版的一样方便区分和调试
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.2</version> <exclusions> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.6-snapshot</version> </dependency>
然后修改springboot的pom后 使用以上代码 排除原版的mybatis的jar包 换上我们自己的snapshot 的 jar就行了
相关文章推荐
- MAVEN 编译spring boot + mybatis 出现 Error parsing Mapper XML.
- 详解Spring boot使用Redis集群替换mybatis二级缓存
- SpringBoot非官方教程 | 第六篇:springboot整合mybatis
- SpringBoot整合Mybatis之进门篇
- SpringBoot用Druid整合MyBatis
- spring boot+mybatis 多数据源报错 No qualifying bean of type [javax.sql.DataSource] is defined:
- Spring Cloud Spring Boot mybatis 企业分布式微服务云(五)服务消费(Feign)【Dalston版】
- Spring boot整合mybatis
- SpringBoot集成MyBatis
- Spring Boot 集成MyBatis
- spring boot,mybatis,angularjs 整合实例
- Spring boot Mybatis 整合2
- SpringBoot入门之整合mybatis
- Spring Cloud Spring Boot mybatis分布式微服务云架构(二)使用Intellij中的Spring Initializr来快速构建Spring Boot/Cloud工程
- springboot启动mybatis
- Spring boot Mybatis 整合(完整版)
- 使用SpringBoot搭建小型项目,集成mybatis,redis,swagger2,并部署在外部容器中。
- springboot与mybatis整合dao层不能注入的问题
- SpringBoot设置jsp页面修改自动编译(无需重启)
- spring boot 通过mybatis连接MySQL数据库