- M2_REPO is a variable that defines where maven 2 repository is on your disk
- This means: add definition of M2_REPO to XML file that defines the eclipse workspace
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…