maven导入破坏了类路径

maven导入破坏了类路径

本文介绍了Intellij maven导入破坏了类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Intellij 13,我现在很乐意使用Maven一段时间来管理JAR依赖项。

I'm using Intellij 13, I've been using Maven quite happily for awhile now to manage the JAR dependencies.

但是最后几个我已经导入了导致类路径问题破坏,并且它们没有被安装到存储库。

But the last few I've imported are causing a broken classpath issue, and they're not being installed to the repository.

我虽然它可能只是JSONPath库,但是当我尝试安装Selenium时驱动程序也发生在这些库中。我检查了本地存储库并且存在目录,但是JAR没有下载。

I though it might be just the JSONPath library, but when I tried to install Selenium drivers it also happened with those libs. I checked the local repository and the directories exist, but the JARs haven't downloaded.

这最近才开始发生,并且很多其他依赖项已经安装好了(但是因为这个问题开始发生了。)我真的不确定是什么原因引起的。

This only started happening recently, and a lot of other dependencies have been installed fine (but not since this issue started happening). I'm really not sure what might have caused it.

有谁知道如何解决这个问题?或者为什么JAR没有安装?我可以从Intellij以某种方式触发更新以尝试重新安装吗?

Does anyone know how to troubleshoot this? Or why the JARs aren't installing? And can I just trigger an update somehow from Intellij to try to reinstall them?

快速编辑:

我尝试使用Intellij的添加库功能安装模块。它安装得很好,而在我直接在pom.xml中更新它们之前它正在下载它们。

I tried installing the modules using Intellij's "add library" feature. It installed them fine, whereas before I was just updating them directly in the pom.xml and it was downloading them.

库功能看起来好一点因为它会自动添加无论如何它们都是我的输出文物,但是如果它也更新了pom就好了,所以我可以在intellij环境之外使用它。

The library feature seems a little better because it automatically adds them to my output artefacts anyway, but it would be nice if it also updated the pom so I can use it outside of the intellij environment.

所以我不确定更新pom.xml的原因不再适用...

So I'm not sure why updating the pom.xml isn't working any more...

推荐答案

我在IntelliJ IDEA 2017中遇到过这个问题最终。

I've had this issue in IntelliJ IDEA 2017 Ultimate.

更改依赖项版本后,IDE无法自行修复路径。我去了〜/ .m2目录并删除了问题jar的所有依赖项,然后执行了ReImport All Maven Projects操作。完成后,依赖性问题得到解决。

After changing dependency versions, the IDE was unable to fix the path on its own. I went to my ~/.m2 directory and deleted all of the dependencies for the problem jar and then executed the "ReImport All Maven Projects" action. When it was complete, the dependency issue was resolved.

这篇关于Intellij maven导入破坏了类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 03:12