Gradle依赖项在IntelliJ中不起作用

Gradle依赖项在IntelliJ中不起作用

本文介绍了Gradle依赖项在IntelliJ中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在和我的朋友一起在intelliJ项目上工作,我们使用MongoDB& Morphia.如您在此处看到的那样,我们在mondle中将mongo东西作为依赖项:

我没有设置这些东西,而是从存储库中克隆出来的.但是我的其他朋友已经在Windows,OSX和Linux上实现了这一功能.而且只有其中之一进行了设置.

问题在于它不知道什么是Morphia/MongoDB(例如,导入无效).

我做了什么:

  • 重新同步Gradle
  • 运行Gradle.build文件
  • 重新克隆项目
  • 使缓存无效并重新启动

它仍然不知道什么是MongoDB.因此,然后我尝试使所有东西都在Ubuntu的VM中运行,但是我遇到了类似的问题,只是它没有列出您在上面看到的任何依赖项.

任何人对我要完成此工作需要做什么有任何想法?

这是Build.gradle,减去定义组的第一行(其中包含我朋友的名字).

可能与该问题有关:他们抱怨某些依赖是无效的".

解决方案

存在无效的依赖关系.我删除了它们,然后它开始工作.

I'm working on an intelliJ project with my friends where we use MongoDB & Morphia. We have the mongo stuff as a dependency in Gradle, as you can see here:

I didn't set this stuff up, I cloned it from a repository. But my other friends have gotten this to work - all on Windows, OSX, and Linux. And only one of them set it up.

The issue is that it doesn't know what Morphia / MongoDB is (for example, the imports don't work).

What I have done:

  • Resync Gradle
  • Run the Gradle.build file
  • Reclone the project
  • Invalidate caching and restart

And it still doesn't know what MongoDB is. So then I tried to get everything working in a VM of Ubuntu, but I have a similar issue, except it doesn't list any of the dependencies you see above.

Anyone have any ideas on what I need to do on my end to get this working?

Here is the Build.gradle, minus the first line where we define the group (it contains my friend's name).

Possibly something to do with the issue: They complain that some of the dependecies are "invalid".

解决方案

There were invalid dependencies. I removed those and it started to work.

这篇关于Gradle依赖项在IntelliJ中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 05:17