此maven
插件基于mybatis-generator
扩展,支持读取.erm
文件生成 Java Dao
层代码。
增加.erm
文件路径ermPath
变量
<properties>
<ermPath>${basedir}/src/main/resources/erms</ermPath>
</properties>
增加 maven plugin
<plugin>
<groupId>com.github.javahello</groupId>
<artifactId>erm-generator-mybatis-maven-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
增加 .erm
文件
<ermSources path="${ermPath}">
<ermSource value="db.erm"/>
<ermSource value="db2.erm"/>
</ermSources>
执行 mvn install
生成MyBatis
实体类和mapper
文件,并编译打包。
mvn install