请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

mybatis-generator生成dao层失败

报错如下;

"C:\Program Files\Java\jdk1.7.0_80\bin\java" "-Dmaven.home=C:\Program Files\apache-maven-3.0.5" "-Dclassworlds.conf=C:\Program Files\apache-maven-3.0.5\bin\m2.conf" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\apache-maven-3.0.5\boot\plexus-classworlds-2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=15.0.6 org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate

[INFO] Scanning for projects...

[WARNING] 

[WARNING] Some problems were encountered while building the effective model for com:mmall:war:1.0-SNAPSHOT

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 264, column 15

[WARNING] 

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING] 

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING] 

[INFO]                                                                         

[INFO] ------------------------------------------------------------------------

[INFO] Building mmall Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO] 

[INFO] --- mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ mmall ---

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 0.882s

[INFO] Finished at: Mon Oct 09 12:31:11 CST 2017

[INFO] Final Memory: 6M/122M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project mmall: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Cannot resolve classpath entry: C:/Users/huang/IdeaProjects/mmall/src/main/tools/mysql-connector-java-5.1.6.jar -> [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


Process finished with exit code 1


基本环境:

我是用虚拟机安装了centos,在window下可以用navicat访问centos上的数据库,关闭了防火墙,给数据库账户开了权限。

数据库的驱动文件是在项目文件中新建文件夹,复制数据库驱动jar包,把硬盘路径写到datasource.properties中。


我的数据库驱动文件:datasource.properties

db.driverLocation=C:/Users/huang/IdeaProjects/mmall/src/main/tools/mysql-connector-java-5.1.6.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://192.168.88.128:3306/mmall_learning?useUnicode=true&characterEncoding=utf-8
db.username=feihong
db.password=feihong


项目图如下:

https://img1.sycdn.imooc.com/szimg//59db03710001ad6b03980805.jpg




正在回答 回答被采纳积分+3

1回答

Geely 2017-10-09 23:28:09

C:/Users/huang/IdeaProjects/mmall/src/main/tools/mysql-connector-java-5.1.6.jar 


同学,这个路径怎么不是-bin的这个jar呢,要用-bin的jar


db.driverLocation=C:/Users/huang/IdeaProjects/mmall/src/main/tools/mysql-connector-java-5.1.6.jar

这个要指向到tools下bin的这个jar哈


另外,看帖子看帖子看帖子,重要的说三遍哈



我给大家整理了这个,有问题可以来看看先找一下。 肯定有你想要的哈


部署环境的话 ,建议看下文章最后一小段哟~


尽快进入咱们QQ群哟~~


课程项目思维导图及线上环境、测试环境、部署linux和windows等解答

http://www.imooc.com/article/20193 


【重点】问答区常见问题整理

http://www.imooc.com/article/18998


课程项目QQ群分享手记

http://www.imooc.com/article/19094



找工作的季节之简历及找工作的分享

http://www.imooc.com/article/19998


项目环境、vsftpd、linux、mysql等各种配置、软件下载

http://learning.happymmall.com


还有还有,课程求10分好评嘻嘻~木啊~~



1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号