请稍等 ...
×

采纳答案成功!

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

关于mybait-generator生成的报错

[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] -----------------------------< com:mmall >------------------------------

[INFO] Building mmall Maven Webapp 1.0-SNAPSHOT

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

[INFO] 

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

[INFO] Connecting to the Database

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

[INFO] BUILD FAILURE

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

[INFO] Total time:  0.437 s

[INFO] Finished at: 2019-06-30T03:39:34+08:00

[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: 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


Process finished with exit code 1


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

1回答

九局下半上衫达也 2019-06-30 05:41:17

https://git.imooc.com/coding-96/coding-96/src/master/src/main/tools  这个网址下载那个mysql jar包 

https://img1.sycdn.imooc.com//szimg/5d17da4e00016e3311100272.jpg

然后放在你电脑一个最好是非中文目录, 把文件路径复制在datasource.properties中即可,比如我的db.driverLocation=D:\\mmall\\mysql-connector-java-5.1.6-bin.jar

windows下目录分隔貌似是用\且需要转义, 我也是试出来的。

https://img1.sycdn.imooc.com//szimg/5d17daeb0001732c05960110.jpg

1 回复 有任何疑惑可以回复我~
  • 提问者 晨澄元 #1
    同学,还是报相同的错误,没有生成出来
    回复 有任何疑惑可以回复我~ 2019-06-30 10:59:04
  • 九局下半上衫达也 回复 提问者 晨澄元 #2
    我好像看错异常了....  这个应该是你pom.xml坐标没配好吧
    plugins 里的
    <plugin>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-maven-plugin</artifactId>
            <version>1.3.2</version>
            <configuration>
              <verbose>true</verbose>
              <overwrite>true</overwrite>
            </configuration>
          </plugin>
    
    还有dependency
    <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.6</version>
        </dependency>
    这两个配好了吗 IDEA下载有没有出错
    回复 有任何疑惑可以回复我~ 2019-06-30 20:33:14
  • win7下要转义,九局下半上衫达也同学写的对
    回复 有任何疑惑可以回复我~ 2019-07-03 18:29:38
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信