Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse : Maven search dependencies doesn't work

I created a new simple Maven project in a new Workspace.

When I open the pom.xml's Dependencies view in Eclipse editor, and I choose Add.. dependency, there's no search results no matter what search criteria I input in the search fields:

It instantly give me, for example, Results for 'spring' (0).

In my other workspace, with my existing projects I don't have this problem.

Is there a way to fix that ?

like image 514
Majid Laissi Avatar asked Dec 27 '12 18:12

Majid Laissi


People also ask

How do I force Maven to Download dependencies in Eclipse?

Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.

Where can I find dependencies in Eclipse?

Right-click the project, then select "Properties", then "Java Build Path". The tabs "Projects" and "Libraries" list what the project depends on. Note that the "Order and Export" tab alllows you to have indirect dependencies. All the information here is saved in a file named .

What happens if the dependencies are not properly placed in Maven?

In your maven project, If the dependencies are placed not properly. This may result to create problems such as unused dependencies, duplicate dependencies, version conflicts…etc. These result… Open in app Home Notifications Lists Stories Write Published in Javarevisited Anish Antony Follow Jan 8, 2021 4 min read Member-only Save

How to update Maven repository Index in Eclipse?

Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading. After downloading completely, artifact searching will be ready to use. UPDATE You also need to rebuild your Maven repository index in 'maven repository view'.

How do I search for artifacts in Eclipse?

Eclipse artifact searching depends on repository's index file. It seems you did not download the index file. Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading.

What is the use of dependency source command in Linux?

dependency:sources This command is for resolving dependencies with their sources. This help for debugging, getting the logics inside the jars, exploring the working libraries … etc. At the end of this command execution, the system will output what the resolved and non resolved source dependencies are.


2 Answers

Eclipse artifact searching depends on repository's index file. It seems you did not download the index file.

Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading.

After downloading completely, artifact searching will be ready to use.

Maven Settings

UPDATE You also need to rebuild your Maven repository index in 'maven repository view'.

In this view , open 'Global Repositories', right-click 'central', check 'Full Index Enable', and then, click 'Rebuild Index' in the same menu.

A 66M index file will be downloaded.

Maven Repositories -> Rebuild Index

like image 180
Xiujun Ma Avatar answered Oct 09 '22 09:10

Xiujun Ma


In your eclipse, go to Windows -> Preferences -> Maven Preferences Maven Screenshot Tick the option "Download repository index updates on startup". You may want to restart the eclipse.

Also go to Windows -> Show view -> Other -> Maven -> Maven repositories Maven Repository View Screenshot

On Maven repositories panel, Expand Global repositories then Right click on Central repositories and check "Full index enabled" option and then click on "Rebuild index".

Full Index Screenshot

like image 22
Hetal Rachh Avatar answered Oct 09 '22 07:10

Hetal Rachh