问答详情
源自:2-4 Mybatis自动生成器使用方式

文件自动生成

[ERROR] No plugin found for prefix 'mybatis-generator' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (F:\maven\repository), nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public)] -> [Help 1]

提问者:慕慕0563197 2019-04-22 10:32

个回答

  • 不是杯具的悲剧
    2019-04-24 07:44:49
    已采纳

    pom没有配置你的plugin吧,在你的pom.xml中把build换成这个试一下

    <build>

    <plugins>

    <plugin>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-maven-plugin</artifactId>

    </plugin>

    <plugin>

    <groupId>org.mybatis.generator</groupId>

    <artifactId>mybatis-generator-maven-plugin</artifactId>

    <version>1.3.5</version>

    <dependencies>

    <dependency>

    <groupId>org.mybatis.generator</groupId>

    <artifactId>mybatis-generator-core</artifactId>

    <version>1.3.5</version>

    </dependency>

    <dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version>5.1.41</version>

    </dependency>

    </dependencies>

    <executions>

    <execution>

    <id>mybatis generator</id>

    <phase>package</phase>

    <goals>

    <goal>generate</goal>

    </goals>

    </execution>

    </executions>

    <configuration>

    <!-- 允许移动生成的文件 -->

    <verbose>true</verbose>

    <!-- 允许自动覆盖文件 -->

    <overwrite>true</overwrite>

    <configurationFile>

    src/main/resources/mybatis-generator.xml

    </configurationFile>

    </configuration>

    </plugin>

    </plugins>

    </build>