项目中使用mybatis-generator-maven-plugin插件报出一下异常
本来想着生成完mapper文件,就开始一把梭的敲代码,一脸毫无问题的表情看着屏幕,奈何,bug总是对我情有独钟
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.470 s
[INFO] Finished at: 2019-09-23T10:06:29+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project ytcms-web: Access denied for user 'cmsadmin'@'172.16.0.32' (using password: YES) -> [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/MojoExecutionException
Process finished with exit code 1
看内容说是拒绝访问,网上搜了好多问题,有的要改服务器得数据库权限啥的,都不好使。
后来问了孟学长,大佬就是大佬啊,不到10s钟就看出问题了,说是
“看日志应该是IP配的不对,看下generator配置文件引用的配置文件”
我看了下generator.xml得配置文件引用得jdbc.properties文件,
#jdbc.url=这里得数据库得地址,已经更换,所以运行不对,改成正确得就好了
#jdbc.username=root
#jdbc.password=123456
#jdbc.driver=com.mysql.jdbc.Driver
还有有的报出jdbc找不到,原因是hi
jdbc.driver=com.mysql.jdbc.Driver
中得键jdbc.driver只能是jdbc.driver,而不能是其它得