mybatis-generator-lombok-plugin 导入jar问题

令狐钧
2023-12-01

在使用mybatis自动生成mapper/dao/bean 文件时,为了配置自动get/set和bean属性注解, 需引入mybatis-generator-lombok-plugin   下载地址:https://github.com/GuoGuiRong/mybatis-generator-lombok-plugin

注意:此时直接在

<dependencies>
    <dependency>
        <groupId>com.chrm</groupId>
        <artifactId>mybatis-generator-lombok-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

时generate时报错Cannot instantiate object of type com.chrm.mybatis.generator.plugins.CommentPlugin ,

需修改成在plugin里引入 即可

<plugin>

<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<configuration>
    <!-- generator 工具配置文件的位置 -->
    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
  
</configuration>
        <dependencies>
       <dependency>
            <groupId>com.chrm</groupId>
            <artifactId>mybatis-generator-lombok-plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
</plugin>

 

 

 类似资料: