配置mybatis-genertor自动生成模型,添加了自定义的序列化类以及分页类。我已按照网上
的方式将我的扩展文件夹打包成jar包,并且安装到本地maven中并在pom文件依赖添加该jar
包的引用,配置如下
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<!--Mybatis-generator插件,用于自动生成Mapper和POJO-->
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.micropay</groupId>
<artifactId>micropay-dal-plugin</artifactId>
<version>1.0.0</version>
<!-- <scope>system</scope>-->
<!--
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
genertor配置文件:
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
<!-- 为生成的Java模型类添加序列化接口,并生成serialVersionUID字段 -->
<plugin type="org.micropay.dal.plugin.SerializablePlugin">
<!-- <plugin type="org.mybatis.generator.plugins.SerializablePlugin">-->
<property name="suppressJavaInterface" value="false"/>
</plugin>
<!-- 生成一个新的selectByExample方法,这个方法可以接收offset和limit参数,主要用来实现分页 -->
<plugin type="org.micropay.dal.plugin.PaginationPlugin"></plugin>
<!-- <plugin type="org.mybatis.generator.plugins.PaginationPlugin"></plugin>-->
<!-- Java模型生成equals和hashcode方法 -->
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
<!-- 生成的代码去掉注释 -->
<commentGenerator type="org.micropay.dal.plugin.CommentGenerator">
<!-- <commentGenerator type="org.mybatis.generator.plugins.CommentGenerator">-->
<property name="suppressAllComments" value="true"/>
<property name="suppressDate" value="true"/>
</commentGenerator>
<!-- 数据库连接 -->
<jdbcConnection driverClass="${generator.jdbc.driver}"
connectionURL="${rator.jdbc.url}"
userId="${generator.jdbc.username}"
password="${generator.jdbc.password}"/>
<!-- 实体类生成的位置 -->
<javaModelGenerator targetPackage="org.micropay.dal.entity" targetProject="src/main/java">
<property name="enableSubPackages" value="false"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- *Mapper.xml 文件的位置 -->
<sqlMapGenerator targetPackage="org.micropay.dal.mapper" targetProject="src/main/resources">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- Mapper 接口文件的位置 -->
<javaClientGenerator targetPackage="org.micropay.dal.mapper" targetProject="src/main/java" type="XMLMAPPER">
<property name="enableSubPackages" value="false"/>
</javaClientGenerator>
自定义插件目录:
目前运行报错:
请大神指教到底什么原因导致。