1.安装jdk1.8;
2.安装intellJ;
3.1 如果是单前用户,配置用户环境变量即可,如果是多用户,则需配置系统环境变量,变量名为MAVEN_HOME,赋值D:\Application\maven,往path中加入%MAVEN_HOME%\bin
3.2 查看是否安装成功,dos窗口执行命令 mvn -v
3.3 配置本地仓库
创建D:\bysu\var文件夹,该目录作为maven的本地仓库,打开D:\Application\maven\conf\settings.xml文件,查找下面这行代码:
<localRepository>/path/to/local/repo</localRepository>
该代码被注释,copy出来,修改路径为刚创建的本地仓库路径D:\bysu\var<localRepository>D:\bysu\var</localRepository>
4在intellij中配置mvn
1. 点击File菜单, 点击Settings
2. 点击展开Build,Execution,Deployment菜单,点击maven菜单
修改Maven home directory为本地maven安装路径 D:\Application\maven
修改User settings file为maven的sittings文件路径 D:\Application\maven\conf\settings.xml
修改Local repository为本地仓库路径 D:/bysu/var
查看Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Ignored Files 该文件是否已勾选,若勾选,去掉勾勾。查看Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Importing,如下图:
未完待续...