202309301820_《Spring boot项目,继承mybatis-generator遇到的问题及解决》

发布时间 2023-09-30 18:46:04作者: Coca-code

 当配置到最后,双击右侧maven tab,准备生成时,报红:

1. “Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.”

解决: mysql版本问题。高版本需cj, 低版本不需要cj。 我的5.7版本,去掉了cj。

  但是改回之后还是红。

解决: 将pom.xml的connector改回地版本。我的版本选择:5.1.6 。

 

2. “Column 'IS_GENERATEDCOLUMN' not found.”

解决: 在pom.xml, 将‘mybatis-genrator’插件从1.3.x升级至“1.4.0”.

 

3 .“The specified target project directory src\main\java does not exist”

解决: 因为Mac系统 “/”不用“\”!!! 将mybatisGenerator.xml文件里涉路径的改回就行。