mybatis插件自动生成代码报错。

Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver (mybatis逆向工程)

 

springboot整合mybatis时出现的问题

解决方法:在pom.xml中plugin中加入单独依赖Mysql驱动包,问题便可解决

复制代码
     <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
                    <overwrite>true</overwrite>
                    <verbose>true</verbose>
                </configuration>
                <!--加入下面这个依赖-->
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>${mysql.version}</version>
                    </dependency>
                </dependencies>

            </plugin>
复制代码

 

posted on 2020-06-03 23:17  坚守梦想  阅读(552)  评论(0编辑  收藏  举报