被依赖项目没有打包到本地仓库 或者没有上传到远程仓库
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project ibps-platform-icms: Compilation failure
[ERROR] /E:/SVN/ibps-budget/ibps-engineering/ibps-platform-root/modules/platform-icms/src/main/java/com/jy/jyplat/budget/acceptance/controller/AcceptanceController.java:[1173,45] 找不到符号
[ERROR] 符号: 方法 insertTable(org.apache.poi.xwpf.usermodel.XWPFDocument)
[ERROR] 位置: 类型为com.jy.jyplat.icms.util.WordReporter的变量 wordReporter
[ERROR] -> [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] /confluence/display/MAVEN/MojoFailureException
先看问题
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project ibps-platform-icms: Compilation failure[ERROR] /E:/SVN/ibps-budget/ibps-engineering/ibps-platform-root/modules/platform-icms/src/main/java/com/jy/jyplat/budget/acceptance/controller/AcceptanceController.java:[1173,45] 找不到符号[ERROR] 符号: 方法 insertTable(org.apache.poi.xwpf.usermodel.XWPFDocument)[ERROR] 位置: 类型为com.jy.jyplat.icms.util.WordReporter的变量 wordReporter[ERROR] -> [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] /confluence/display/MAVEN/MojoFailureException
我在开发中多次遇到该问题,前几次有时候莫名其妙就好了。一懒惰就没有理它,今天有出现了,一出现就浪费了我一上午,到处百度都没有找到解决方案。甚至直接将找不到符号的jar包直接复制到maven本地仓库。还是不能解决问题,在我的认知里面,maven打包时获取jar包资源的优先级应该是:本地仓库>私服>远程仓库有懂得可以留言讨论。
下面是我最终找到的解决方案,打包被依赖项目时使用下面语句
deploy -Dmaven.test.skip=true
如果你使用的是IDEA