我的学习笔记——mybatis-generator 所遇到问题(一)
问题log:
"C:\Program Files\Java\jdk1.8.0_40\bin\java.exe" -Dmaven.multiModuleProjectDirectory=E:\demo\rja_api -Dmaven.home=D:\TOOLS\maven\apache-maven-3.5.3 -Dclassworlds.conf=D:\TOOLS\maven\apache-maven-3.5.3\bin\m2.conf "-javaagent:D:\TOOLS\idea\IntelliJ IDEA 2018.1.4\lib\idea_rt.jar=62021:D:\TOOLS\idea\IntelliJ IDEA 2018.1.4\bin" -Dfile.encoding=UTF-8 -classpath D:\TOOLS\maven\apache-maven-3.5.3\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2018.1.4 -s D:\TOOLS\maven\apache-maven-3.5.3\conf\settings.xml -Dmaven.repo.local=D:\TOOLS\maven\apache-maven-3.5.3\repository org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate -f pom.xml
[INFO] Scanning for projects...[INFO]
[INFO] --------------------------< com.fsd:rja_api >---------------------------
[INFO] Building rja_api 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ rja_api ---
[ERROR] <properties> resource generator.properties does not exist
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.493 s
[INFO] Finished at: 2018-06-21T22:03:54+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project rja_api: <properties> resource generator.properties 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
Process finished with exit code 1
原因:
错误原因是maven无法找到对应<properties> resource文件.
解决方法:
1.检查properties文件,每一行的行首和行末,是否有多余的空格,将其删掉;
2.在maven的pom.xml文件中,加入如下的<resource>配置:
如图