报错内容:
Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate (default-cli) on project OrderFood: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate failed: Exception getting JDBC Driver
具体如下图:
解决办法:
在pom.xml文件mybatis的build 打包配置中加上数据库的配置:
1 <plugin> 2 <groupId>org.mybatis.generator</groupId> 3 <artifactId>mybatis-generator-maven-plugin</artifactId> 4 <version>1.3.7</version> 5 <dependencies> 6 <dependency> 7 <groupId>mysql</groupId> 8 <artifactId>mysql-connector-java</artifactId> 9 <version>5.1.46</version> 10 </dependency> 11 </dependencies> 12 <configuration> 13 <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile> 14 <overwrite>true</overwrite> 15 <verbose>true</verbose> 16 </configuration> 17 18 </plugin>
参考文档地址:
https://blog.csdn.net/shasiqq/article/details/88807099