开发者社区> 论尽先生> 正文

mybatis-generator:generate无法生成dao层pojo层mapper层,漏了转义字符

简介:
+关注继续查看
"C:\Program Files\Java\jdk1.8.0_171\bin\java.exe" -Dmaven.multiModuleProjectDirectory=E:\IDEA\mmall "-Dmaven.home=E:\IDEA\IntelliJ IDEA 2018.1.5\plugins\maven\lib\maven3" "-Dclassworlds.conf=E:\IDEA\IntelliJ IDEA 2018.1.5\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:E:\IDEA\IntelliJ IDEA 2018.1.5\lib\idea_rt.jar=53876:E:\IDEA\IntelliJ IDEA 2018.1.5\bin" -Dfile.encoding=UTF-8 -classpath "E:\IDEA\IntelliJ IDEA 2018.1.5\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.1.5 org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate -f pom.xml
[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 266, 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: 1.514 s
[INFO] Finished at: 2018-10-25T12:22:38+08:00
[INFO] Final Memory: 9M/113M
[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\Administrator.m2\repository\mysql\mysql-connector-java\8.0.12\mysql-connector-java-8.0.12.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

报错如上,datasource.properties写的是数据库的属性配置

db.driverLocation=C:\\Users\\Administrator\这里的斜杠漏了转义字符,运行时无法读取斜杠.m2\\repository\\mysql\\mysql-connector-java\\8.0.12\\mysql-connector-java-8.0.12.jar
db.driverClassName=com.mysql.cj.jdbc.Driver

应该为:

db.driverLocation=C:\\Users\\Administrator\\.m2\\repository\\mysql\\mysql-connector-java\\8.0.12\\mysql-connector-java-8.0.12.jar
db.driverClassName=com.mysql.cj.jdbc.Driver

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
09-Mybatis的dao层实现原理
09-Mybatis的dao层实现原理
14 0
Mybatis Mapper代理开发Dao层
Mybatis Mapper代理开发Dao层
40 0
Mybatis中Dao接口的工作原理
Mybatis中Dao接口的工作原理
44 0
Mybatis mapper层 同时传入实体类和单独的参数
Mybatis mapper层 同时传入实体类和单独的参数
249 0
Mybatis基于传统dao层的开发(完整代码演示)
Mybatis基于传统dao层的开发(完整代码演示)
52 0
JavaWeb - PO、BO、VO、DTO、POJO、DAO 概念 & 作用(附:转换图)
JavaWeb - PO、BO、VO、DTO、POJO、DAO 概念 & 作用(附:转换图)
207 0
【MyBatis框架点滴】——MyBatis开发DAO的两种方法:原始DAO开发方法和Mapper代理方法
  MyBatis常用的开发DAO的方式有两种,第一种就是常用的原始DAO的开发方法,第二种就是Mapper代理的方法。
134 0
【MyBatis框架点滴】——MyBatis输出映射
  上文说到,MyBatis中,通过parameterType指定输入参数的类型。这里说一下用resultType和resultMap来指定输出参数的类型。
54 0
【框架】[MyBatis]DAO层只写接口,不用写实现类
【框架】[MyBatis]DAO层只写接口,不用写实现类
126 0
+关注
论尽先生
哈哈哈
文章
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载