maven mybatis-generator报错

报错信息:generate failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver

很显然是数据库驱动的jar包除了问题,更新了几个版本无果后上网查询:

<plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <overwrite>true</overwrite>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.6</version>
                    </dependency>
                </dependencies>
         </plugin>

在plugin中单独依赖Mysql驱动包(知道原因的大佬希望留言哦)

相关推荐