11

NetBeans and Eclipse have nice little wizards which allow me to search local and remote Maven repositories and add any dependency correctly to my POM.

Does IntelliJ (community edition) support anything of this sort?

Zoltán
  • 21,321
  • 14
  • 93
  • 134

1 Answers1

20

In pom.xml press Alt + Insert. In the small pop-up click on Dependency.

enter image description here

There you can search any artifact or class. It looks like:

enter image description here

You also need to make sure that the local and remote repositories you are using have been indexed by IntelliJ. That can easily be done in Settings -> Maven -> Repositories (more details here)

infojolt
  • 5,244
  • 3
  • 40
  • 82
geoand
  • 60,071
  • 24
  • 172
  • 190
  • Nice! It looks just like what I was looking for. However, it seems to contain a very small set of available artifacts. E.g. I can't find Guava or EasyMock in it. What gives? – Zoltán Aug 28 '14 at 09:06
  • I searched both and it worked! Are you sure that your repositories are setup correctly? – geoand Aug 28 '14 at 09:08
  • Well, it's a fresh install of Maven, I haven't changed `settings.xml` at all yet, which should imply that at least the central repository should be set up correctly. Funny thing is - Guava is even in my local repo and IntelliJ still can't find it. – Zoltán Aug 28 '14 at 09:12
  • @Zoltán That is indeed weird! I'll check and see if there is anything else I can find – geoand Aug 28 '14 at 09:16
  • 2
    @Zoltán Have you checked in `Settins` -> `Maven` -> `Repositories` to see what repositories are indexed? – geoand Aug 28 '14 at 09:18
  • I also just realized that my remote repo said that it was **never** indexed, and my local repository was last indexed yesterday. It solved the problem. Thanks a lot! Perhaps you could update your answer and add this information as a note. – Zoltán Aug 28 '14 at 09:26