首先是pom.xml文件配置,引入mybatis-generator插件
<plugins>
<!-- mybatis generator -->
<plugin>
<!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-maven-plugin -->
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
pom.xml右键选择
执行mvn mybatis-generator:generate命令
成功执行:
生成的pojo mapper接口和映射文件