I have a few questions corresponding to this.
- What is M2_REPO?
What does this command do?
mvn -Declipse.workspace=<your_workspace_location> eclipse:add-maven-repo
Why do we need to do the above?
I have a few questions corresponding to this.
What does this command do?
mvn -Declipse.workspace=<your_workspace_location> eclipse:add-maven-repo
Why do we need to do the above?
You can do the same manually if you want. That is what I personally did. Just go to Window/Preferences and then choose Java/Build Path/Classpath Variables. Once you did it you can enjoy maven integration with eclipse. Every time you add new dependency to your pom.xml, run
mvn eclipse:eclipse
and refresh you workspace you get all new libraries into classpath of your project.
EDIT
This answer was written 5 years ago. These days any eclipse distribution has maven plugin, so eclipse can open maven project directly. Every dependency you add to your pom.xml is automatically downloaded and almost immediately ready to use.