项目地址:https://github.com/xuanshuangchen/canna-cloud.git
自定义代码生成插件
1、配置pom.xml:
<profile>
<id>mybatis</id>
<build>
<plugins>
<plugin>
<groupId>com.flower.canna.cloud</groupId>
<artifactId>canna-cloud-maven-plugin</artifactId>
<version>1.0.0.0</version>
<configuration>
<outputDirectory>target/classes/</outputDirectory>
<workDirectory>target/work/</workDirectory>
<configFileName>generator/generator.properties</configFileName>
</configuration>
<executions>
<execution>
<id>myBatisGenerator</id>
<phase>package</phase>
<goals>
<goal>myBatisGenerator</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
2、在需要生成的工程目录下,配置如下文件:
generator/generator.properties
3、插件通过自动获取maven本地仓库地址,再拼接相应的driverJarPath,得到相应的驱动;
使用canna-cloud-mybatis-generator自动生成器,调用如下命令,可直接重复生成相应的模块。
mvn clean package -P mybatis