springboot整合mybatis-generator报错:Failed to execute goal org.mybatis.generator:mybatis-generator-maven

整合时遇到了两个错误:
错误1:

Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:
generate (default-cli) on project XXX: 
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 -> [Help 1]

解决方法:
在pom文件中引入generator插件时,重新引入mysql的pom,如下所示:


            
                org.mybatis.generator
                mybatis-generator-maven-plugin
                1.3.2
                
                    ${basedir}/src/main/resources/generator/generatorConfig.xml
                    true
                    true
                
                
                    
                        mysql
                        mysql-connector-java
                        5.1.29
                    
                
            

错误2:

Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project spring-two-demo: Cannot connect to database (possibly bad driver/URL combination) -> [Help 1]

解决方法:
不能连接数据库,直接找generator配置文件中连接数据库那块配置:最后发现路径写错了。
jdbcConnection配置,mysql的配置应该如下,"connectionURL=“jdbc:mysql://localhost:3306/test”
完整的连接属性:

 
        

你可能感兴趣的:(项目报错及解决方法,springboot,springboot学习之路)