Search code examples
javamavenintellij-idea

Unable To Search For Dependencies In IntelliJ


I recall being able to search for dependencies using the console at the bottom of IntelliJ. For example, I was searching for Apache POI.

I can find dependencies on my current laptop's IntelliJ:

However on my other laptop, I am unable to search for anything EXCEPT for existing dependencies that are already in my project. It will simply say: "No dependencies found etc."

I've tried looking for answers and most of them direct me to:

  1. Open pom.xml -> Right-click on code -> Generate... -> Add dependency...
  2. File -> Invalidate Caches... -> Invalidate and Restart
  3. File -> Project Structure... -> Modules -> Dependencies -> "+" sign to add jar file -> Search dependency name in console at the bottom

All these still fetches 0 results when I search for keyword like "poi".


Solution

  • I am unsure if what I have done fixes the issues, but it started working after doing the following steps:

    1. Go to File -> Repair IDE
    2. Click on Rescan project indexes
    3. Reopen Project
    4. Actions -> Delete Package Search project caches -> Delete Package Search global caches
    5. Reindex project -> Invalidate Caches and Restart
    6. Tick everything on the popup menu
    7. Invalidate and Restart
    8. When the popup asks to Download prebuilt shared indexes, click on Always download

    For some reason, my package search has started working again. I am now able to search for dependencies. I have checked that there aren't any network issues. It started working after I have done the above steps. I hope it can help someone out there with the same problem.

    Do note that I am unsure if the above steps may have caused other issues. So far it has posed no other problems for me.