maven package打包时,会自动执行 mybatis-generator-maven-plugin 插件,导致mapper映射文件被追加而出现错误,
实体也会被覆盖。
在pom.xml的mybatis-generator-maven-plugin插件中设置
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<phase>deploy</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
设置phase为deploy