SpringBoot 2.1.1.RELEASE 集成MyBatis

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot 2.1.1.RELEASE 集成MyBatis相关的知识,希望对你有一定的参考价值。

SpringBoot 2.1.1.RELEASE 集成MyBatis
maven工程:
详细配置见:
http://www.qchcloud.cn/system/article/show/63
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">;
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.qchcloud</groupId>
<artifactId>iot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>iot</name>
<description>iot project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
    <mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
</properties>

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>${mybatis.spring.boot.starter.version}</version>
    </dependency>
    <dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0-rc2</version>

</dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

</project>

以上是关于SpringBoot 2.1.1.RELEASE 集成MyBatis的主要内容,如果未能解决你的问题,请参考以下文章

SpringBoot 2.1.1.RELEASE 集成MyBatis

SpringBoot 2.1.1.RELEASE集成devtools

SpringBoot 2.1.1.RELEASE 集成quartz

SpringBoot 2.1.1.RELEASE 集成Email

SpringBoot 2.1.1.RELEASE 集成log4j2

SpringBoot-整合Swagger2