Maven 包有效,但 Intellij 的构建失败 [英] Maven package works but Intellij's build fails

查看:27
本文介绍了Maven 包有效,但 Intellij 的构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 JDK 1.7 项目,它对我的​​ Maven 存储库中的本地 jar 有 Maven 依赖.

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 依赖
  • 在 Intellij 的 Maven 配置中标记为自动加载快照"
  • 在 Intellij 中重新引入 maven
  • 同步

这个错误在我之前发生过几次,但通常只是关闭 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 文件和 pom 冲突并导致了问题.

I've found out that my .iml file and pom were conflicting and causing the issue.

这篇关于Maven 包有效,但 Intellij 的构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆