<?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">
    <!--mapper模块用于Mybatis操作数据库的模块-->
    <parent>
        <artifactId>parent</artifactId>
        <groupId>com.aldebaran</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <artifactId>mapper</artifactId>

    <dependencies>

        <!--mapper模块需要依赖实体类pojo-->
        <dependency>
            <groupId>com.aldebaran</groupId>
            <artifactId>pojo</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <!--MySQL Driver Dependency-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <!--MyBatis Dependency-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
        </dependency>

        <!--MyBatis Integration Spring Dependency-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--MyBatis Generator Plugin-->
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>${mybatis-generator.version}</version>
            </plugin>
        </plugins>

        <!--非常重要，因为打包时必须包含mapper的xml，没有这个配置在打包后会缺少该mapper的xml导致项目无法运行。如果不配置该<resources>，可以将该映射配置文件mapper的xml放到resources文件夹中-->
        <!--从resources目录拷贝，也从java目录拷贝，这样才能把接口所对应的映射配置文件拷贝到打包的项目当中-->
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <!--resources目前只有generatorConfig.xml用来自动生成pojo和
            mapper类的，可以不需要被打包，所以可以不写下面这个代码-->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>

        </resources>

    </build>

</project>