Maven Windows 安装
2019-10-24 本文已影响0人
一只特立独行的猪1991
1、下载(3.3.9)
2、解压并配置
- 新建系统变量M2_HOME

- 在系统变量PATH中新增

3、测试

4、配置仓库
- 全局配置:$M2_HOME/conf/settings.xml
- 用户配置:$USER.HOME/.m2/settings.xml
- 配置创建项目时maven默认的JDK版本
- 配置本地仓库
- 配置阿里云仓库
<?xml version="1.0" encoding="UTF-8"?>
<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>D:/software/Maven/repo</localRepository>
<mirrors>
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
<profiles>
<!--配置创建项目时maven默认的JDK版本-->
<profile>
<id>JDK-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
</settings>
5、IDEA使用maven

6、pom文件解析