mybatis-generator, failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver Solutions

mybatis integrated generator automatic code generation, after configuring generatorConfig.xml file, execute mybatis-generator: generate command reported abnormal

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: 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]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver

The first reaction is to look at pom file has no reference to the jar package mysql link

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.38</version>
</dependency>

But unfortunately their allocation, and a loss

Online neighborhoods expert guidance, found himself precisely applied pagination plug-in

In the generator configuration in plus mysql-connector-java perfect solution again

 <!-- mybatis generator 自动生成代码插件 -->
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.38</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
                    <overwrite>true</overwrite>
                    <verbose>true</verbose>
                </configuration>
            </plugin>

 

Reply attention [information], free access to information architecture, video, as well as curated face questions


 

Published 58 original articles · won praise 40 · views 120 000 +

Guess you like

Origin blog.csdn.net/xinzhifu1/article/details/85126573