eclipse 中修改 M2_REPO的值
转自: http://blog.csdn.net/xuechongyang/article/details/8267440 从eclipse中增加了maven2的插件之后,maven默认的本地库的路径是${user}/.m2/repository/下,一般windows用户的 操作系统 都安装在C盘,所以这个目录 下的jar包比较危险。我尝试从myeclipse->preferences-> Java ->build path->classpath variables中查找M2_REPO这个变量,发现其路径指向的是“C:/Documents and Settings/lvxda/.m2/repository/”,我想修改其路径为:d:/m2/repository,可是这个变量的编辑按钮是灰色的,不可编辑。从网上也没有找到相应的解决 办法。打算自己尝试一下: 1、手动创建本地仓库的地址为:d:/m2/repository 2、从windows的环境变量中增加了:M2_REPO=d:/m2/repository,同时把这个变量增加到path变量中。 3、修改d:/maven/conf/setting.xml文件,在<localRepository>节点下新增一行: 代码:<localRepository>d:/m2/repository</localRepository>