mybatis-generator自动生成controller和service代码问题
按照这里的文章配置了xml文件,但是 生成时报错 https://www.codenong.com/cs106812466/
Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.3:generate (default-cli) on project mass-base: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.3:generate failed: Cannot instantiate object of type com.meadding.mass.base.ServiceAndControllerGeneratorPlugin
参考 https://www.cnblogs.com/zgq7/p/11376925.html ,报错形式一样,但不是同一个问题
generatorConfiga.xml内容如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<context id="MySqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<property name="javaFileEncoding" value="UTF-8"/>
<!-- 为模型生成序列化方法-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
<!--生成mapper.xml时覆盖原文件-->
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
<plugin type="com.meadding.mass.base.ServiceAndControllerGeneratorPlugin" >
<property name="targetProject" value="./src/main/java"/>
<property name="servicePackage" value="com.meadding.mass.supplierPerformance.service"/>
<property name="serviceImplPackage" value="com.meadding.mass.supplierPerformance.service.impl"/>
<property name="controllerPackage" value="com.meadding.mass.supplierPerformance.controller"/>
<!--UserService,该值则为Service-->
<property name="serviceSuffix" value="Service"/>
<!--Service接口的父接口-->
<property name="superServiceInterface" value="org.aurochsframework.boot.commons.service.GeneralService"/>
<!--ServiceImpl的父类-->
<property name="superServiceImpl" value="org.aurochsframework.boot.commons.service.AbstractGeneralService"/>
<!--controller的父类接口-->
<property name="superController" value="org.aurochsframework.boot.commons.controller.GeneralCrudController"/>
</plugin>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/mass"
userId="root"
password="Abcd1234">
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
<!--指定生成model的路径-->
<javaModelGenerator targetPackage="com.meadding.mass.base.model"
targetProject="./src/main/java"/>
<!--指定生成mapper.xml的路径-->
<sqlMapGenerator targetPackage="com.meadding.mass.base.mapper"
targetProject="./src/main/resources"/>
<!--指定生成mapper接口的的路径-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.meadding.mass.base.mapper"
targetProject="./src/main/java"/>
<table tableName="sys_supplier_performance"></table>
</context>
</generatorConfiguration>