一:配置环境变量:
去官网下载maven 压缩包3.5.3
然后解压到:E:\maven
进入maven的目录文件conf下,修改setting.xml。修改本地仓库。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>F:\Repositories\maven</localRepository>
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</interactiveMode>
-->
修改环境变量:
计算机-右键-属性-高级系统设置-环境变量:
系统环境变量中点 添加:变量名MAVNE_HOME 值:E:\maven\maven3.5.3
path:最后追加%MAVEN_HOME%\bin
测试:Windows+r 输入cmd 然后输入:mvn -version
能看到版本号就说明配置好了。
二:eclipse引用windows安装的maven
打开eclipse Windows-preferences-maven-installations 点击add 选择maven的安装路径就可以了。最后确定
选择User Settings 选择Browser 然后找到maven的conf/settings.xml 最后选择应用,ok就可以。