Maven包可以工作,但Intellij的构建失败了 [英] Maven package works but Intellij's build fails
问题描述
我有一个JDK 1.7项目,maven依赖于我的maven仓库中的本地jar。
I have a JDK 1.7 project with a maven dependency to a local jar in my maven repo.
我无法使用Intellij构建项目,无法找到符号的错误(符号是从本地jar导入包的类)
I'm unable to build the project using Intellij, with the errors that a symbol cannot be found (the symbol is a class importing packages from the local jar)
但我可以使用'mvn package'成功构建项目。
But I can successfully build the project using 'mvn package'.
我花了很多时间寻找解决方案,我已经做过的事情:
I've spent so much time looking for solutions, things I've already done:
- 无效缓存
- 'mvn clean install'本地jar dependecy
- 在Intellij的maven配置中标记为'autoload snapshots'
- 在Intellij中重新插入maven
- Syncornized
- Invalidated cache
- 'mvn clean install' the local jar dependecy
- Marked to 'autoload snapshots' in Intellij's maven configuration
- Reimpoted maven in Intellij
- Syncornized
此错误发生在我以前几次,但通常只是关闭Intellij和/或做'mvn clean install'就行了。
This error happend to my couple of times before, but usually just closing the Intellij and /or doing the 'mvn clean install' did the trick.
请帮忙。
推荐答案
我发现我的.iml文件和po m是冲突的并导致问题。
I've found out that my .iml file and pom were conflicting and causing the issue.
这篇关于Maven包可以工作,但Intellij的构建失败了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!