mybatis的generator出現Exception getting JDBC Driver
Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project miaosha: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5: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
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.694 s
查看了pom.xml文件中編寫的內容 沒發(fā)現緣由,但是在去掉dependcy時還是會出現這個問題...癥狀一致
請諸位告知可能引發(fā)這個問題出現的原因,好修改。
<plugin> ???<groupId>org.mybatis.generator</groupId> ???<artifactId>mybatis-generator-maven-plugin</artifactId> ???<version>1.3.5</version> ???<!--?實際項目會有反復的情況--> ???<configuration> ?????<!--?允許移動生成的文件??默認不可以??是否覆蓋設置為true--> ?????<verbose>true</verbose> ?????<overwrite>true</overwrite> ?????<configurationFile> ???????src/main/resources/mybatis-generator.xml ?????</configurationFile> ???</configuration> ???<!--?使用插件必須要有依賴--> ???<!--?使用的是mysql數據庫?因此對Mysql進行解析--> ???<dependencies> ?????<dependency> ???????<groupId>org.mybatis.generator</groupId> ???????<artifactId>mybatis-generator-core</artifactId> ???????<version>1.3.5</version> ?????</dependency> ?????<dependency> ???????<groupId>mysql</groupId> ???????<artifactId>mysql-connector-java</artifactId> ???????<version>5.1.41</version> ?????</dependency> </dependencies> <!--?指定導入之后要做的execution--> ???<!--?phase階段在package階段??goal是做一個generate--> ???<executions> ?????<execution> ???????<id>mybatis?generator</id> ???????<phase>package</phase> ???????<goals> ?????????<goal>generate</goal> ???????</goals> ?????</execution> ???</executions> ?</plugin>
2019-01-04
問題解決了,pom。xml文件沒有問題。對比別人mybatis-generator.xml文件沒有任何區(qū)別,但是我嘗試下將別人的代碼拷貝進來后,居然成功了,成功了。。。。檢查后發(fā)現是連接池這里可能存在問題,也許是哪里多了空格還是啥的....沒發(fā)現。