JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.
Maven dependencies can be read from Eclipse IDE which maven exposes through M2_REPO classpath variable. m2_repo points to maven’s local repository location in workspace.
m2_repo class variable must be added to eclipse’s class path variable on build path before using maven’s dependencies.
1. Manually change maven repository location in Eclipse
1.1. Navigate to Windows > Preferences
1.2. Navigate to Java > Build path > Classpath Variables
1.3. Define new classpath variable “M2_REPO”
Create new variable M2_REPO and point it to maven local repository location.
1.4. Verify that variable has been added
2. Update M2_REPO from command line – eclipse:configure-workspace
Alternatively, you can define and add M2_REPO via Maven command "eclipse:configure-workspace".
For example this is the output of command in my system.
Console
Microsoft Windows [Version 10.0.17134.228]
(c) 2018Microsoft Corporation. All rights reserved.