No plugin found for prefix ‘mybatis-generator‘ in the current project and in the plugin groups

wrong description:

Use MyBatis Generator to automatically generate mappings when given
No plugin found for prefix 'mybatis- generator' in the current project and in the plugin groups
not found in the current project group and plug the prefix 'mybatisi -generator' plug-ins

Insert picture description here

wrong reason

Because the mybatis-generator plugin is not imported in pom.xml

Solution

Add the mybatis-generator plugin in the <plugins> tag

		<!--	mybatis-generator插件 用于自动生成javabean和sql
            	version版本要与对应依赖版本一致
        -->
        <plugin>
          <groupId>org.mybatis.generator</groupId>
          <artifactId>mybatis-generator-maven-plugin</artifactId>
          <version>1.3.4</version>
          <dependencies>
            <dependency>
              <groupId>mysql</groupId>
              <artifactId>mysql-connector-java</artifactId>
              <version>5.1.38</version>
            </dependency>
          </dependencies>
          <configuration>
            <overwrite>true</overwrite>
            <configurationFile>./mybatis-generator.xml</configurationFile>
          </configuration>
        </plugin>

The version must be consistent:
this is my dependent version (to be consistent)

<!--mysql驱动类-->
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.38</version>
    </dependency>
<!--  mybatis-generator的依赖 自动生成javabean和sql -->
    <dependency>
      <groupId>org.mybatis.generator</groupId>
      <artifactId>mybatis-generator-maven-plugin</artifactId>
      <version>1.3.4</version>
    </dependency>

Guess you like

Origin blog.csdn.net/qq_40542534/article/details/108812822
Recommended