Mybatis-generator idea maven 运行项配置和生成重复xml代码解决

Mybatis-generator 生成重复xml代码

添加maven运行项:
mybatis-generator:generate -e

问题:
当多次运行Mybatis-generator插件生成文件时,xml文件出现重复代码,程序无法运行。

插件版本:1.3.4

<plugin>
         <groupId>org.mybatis.generator</groupId>
         <artifactId>mybatis-generator-maven-plugin</artifactId>
         <version>1.3.4</version>
         <configuration>
               <verbose>true</verbose>
               <overwrite>true</overwrite>
         </configuration>
 </plugin>

解决方法:
去掉这一行代码,即在生成代码时不去除注释

<property name="suppressAllComments" value="true"/>

猜你喜欢

转载自blog.csdn.net/qq_36085004/article/details/82983881