We know that what is use maven and how to use it from command prompt. Maven dependencies can be read from eclipse IDE also which maven exposes through M2_REPO classpath variable which points to maven’s local repository. This class variable must be added to eclipse ‘s class path variable on build path before using maven’s dependencies. Lets see how to do this:
Step 1) Go to menu Windows > Preferences
Step 2) Navigate to Java > Build path > Classpath Variables
Step 3) Define new classpath variable M2_REPO and point it to local maven repository
Step 4) Verify that variable has been added
Happy Learning !!