add library from maven: IDEA doesn't see the artifact

Hi!
I have a regular project and want to use the "add lib from maven" feature.
I want to add commons io. I type "commons io" in the search, but it only finds old version (2.1), while the standard maven repo http://repo1.maven.org/ has the latest 2.4
What repo does IDEA use, if not the standard?
Thanks!

5 comments
Comment actions Permalink

I can't remember what repos IDEA searches by default since I set them up so long ago. It might only be the local repo by default. Regardless, it is configurable. But more importantly, it is important to understand that it only searches a cached index of the repository. The index can be updated.

To configure, go to  File >Settings >Project Settings > Maven (or just click the settings icon on the maven tool window). Expand the maven node and select "repositories". Here you can add a repositories to index (and then index them). In the lower half, you can add nexus and artifactory URLs to use. (For nexus, you need to map the URL repo.example.com/nexus/service/local).

Click the help button on the settings dialog for more information.

0
Comment actions Permalink

Thanks for the answer. I saw that dialog, but I don't get how to use it.
The update button is inactive, and there's no way to add repositories to index (see the screen)
Screenshot from 2012-09-19 08:55:03.png
I can add the urls to the bottom list, but how to add them to the upper list for index?



Attachment(s):
Screenshot from 2012-09-19 08:55:03.png
1
Comment actions Permalink

Looks like URLs from the top list (at least, some of them) come from your Maven's settings.xml file. Check your projects Maven settings to see, which settings.xml file you are using (default is ~/.m2/settings.xml).



Attachment(s):
maven_settings.png
0
Comment actions Permalink

"From maven" libraries use URL list on the bottom of that page because they need not a maven repository itself but Nexus or Artifactory service.
The list on the top contains maven repositories you use in a maven-based project. You don't really need them to simply download and configure a library.

0
Comment actions Permalink

But how can I add the maven central.
I've tried to add http://central.maven.org/maven2 into the lower part, but the "Test" button responds "no repositories found"
I.e how can I make idea find commons-io v 2.4 (latest ) :)

0

Please sign in to leave a comment.