mybatis-generator文件运行报错

喜欢ヅ旅行 2023-06-14 10:44 88阅读 0赞

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project miaosha: configfile D:\idea\Student\miaosha\src\main\resources\mybatis-generator.xml does not exist -> [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
嗯嗯嗯。。。。。。。。。。。。。。。。
搞了好长时间,是因为

  1. <configurationFile>
  2. src/main/resources/mapping/mybatis-generator.xml
  3. </configurationFile>
  4. mybatis-generator多一个.xml, <configurationFile>里的文件名称要和自己的文件名一致

在这里插入图片描述

另外,还有其他问题报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [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:

解决方法:

maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。解决方法在pom.xml加入以下的配置。

simple-webapp org.apache.maven.plugins maven-war-plugin 2.1.1 自己的根目录

发表评论

表情:
评论列表 (有 0 条评论,88人围观)

还没有评论,来说两句吧...

相关阅读