2

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:

enter image description 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).

enter image description here

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

enter image description here

enter image description here

CaptainForge
  • 1,365
  • 7
  • 21
  • 46
  • Any chance you can post a small sample of your build.gradle? – bszeliga Mar 15 '16 at 14:14
  • I think the first screen shot also contains your friends name in the first dependency??? – Jens Schauder Mar 15 '16 at 14:34
  • If your gradle build doesn't work on the console there is no point in trying to make an IDE work with it. Show as the error you get on the console. (I'm betting it doesn't find some dependencies, which might be a firewall/proxy problem) – Jens Schauder Mar 15 '16 at 15:08

2 Answers2

1

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

Makoto
  • 104,088
  • 27
  • 192
  • 230
CaptainForge
  • 1,365
  • 7
  • 21
  • 46
0

Not a solution, but a couple of things to try/verify (and also a little long for a comment)

  1. Does a java class that does not use any of the dependencies compile?

  2. Does the gradle build work in a shell/console?

  3. Does IntelliJ actually pick up the changes to the build file. For example change the version of a dependency, hit the reload button in IntelliJ and check if the version gets updated.

  4. Check the project/module settings if the Dependencies are listed as expected

  5. Are you using everywhere the same version of Gradle? The use of the gradle wrapper is recommended.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
  • 1. Yes. 2. No, the gradle build does not work, it actually complains about not knowing any of the dependencies, even the ones that work in IntelliJ. 3. It does, I think. 4. It does show up, but some of them show up as "invalid". I will update the OP with a picture of what I'm talking about. 5. Yeah, we should be. Again, this works on my friends' systems. – CaptainForge Mar 15 '16 at 14:59