How do I add a Maven dependency in Eclipse?
- On the top menu bar, open Window -> Show View -> Other
- In the Show View window, open Maven -> Maven Repositories
- In the window that appears, right-click on Global Repositories and select Go Into
- Right-click on "central (http://repo.maven.apache.org/maven2)" and select "Rebuild Index"
- Note that it will take very long to complete the download!!!
- Once indexing is complete, Right-click on the project -> Maven -> Add Dependency and start typing the name of the project you want to import (such as "hibernate").
- The search results will auto-fill in the "Search Results" box below.
In fact when you open the pom.xml, you should see 5 tabs in the bottom. Click the pom.xml, and you can type whatever dependencies you want.