IDEA常用操作

使用Mybatis-Generator逆向工程生成pojo、mapper

1、添加依赖插件:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-maven-plugin</artifactId>
            <version>1.3.6</version>
            <configuration>
                <!--配置文件的位置-->
                <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
                <verbose>true</verbose>
                <overwrite>true</overwrite>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>${mysql.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

2、添加配置文件generatorConfig.xml

3、配置idea

点击菜单Run->Edit Configuration,然后在弹出窗体的左上角,点击+->maven,会出现下面窗体
IDEA常用操作

命令: mybatis-generator:generate -e

相关推荐