maven安装
2016-01-14 16:11
639 查看
1.下载并加压maven
2.配置环境变量(M2_HOME.Path)
拷贝路径(D:\maven\apache-maven-3.2.3),新建环境变量名为M2_HOME,值为拷贝路径。
编辑Path将,%M2_HOME%\bin;添加到Path中,点击确定。
测试一下,打开cmd,输入命令mvn -version回车,出现maven版本信息等则安装成功。
3.配置maven配置文件(本地仓库路径,镜像)
找到解压路径下的conf的目录,进入目录,找到settings.xml文件,将文件拷贝到C:\Users\Administrator\.m2目录下,打开settings.xml,找到 如下两个地方:
1.<!-- 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>D:\maven\repo</localRepository><!-- 自定义maven仓库的位置,如果不设置那么默认存储在${user.home}/.m2/repository下 -->
2. <mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror><!-- 配置镜像,降低中心仓库的负载 -->
<id>UK</id>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
这样maven就安装好了。
2.配置环境变量(M2_HOME.Path)
拷贝路径(D:\maven\apache-maven-3.2.3),新建环境变量名为M2_HOME,值为拷贝路径。
编辑Path将,%M2_HOME%\bin;添加到Path中,点击确定。
测试一下,打开cmd,输入命令mvn -version回车,出现maven版本信息等则安装成功。
3.配置maven配置文件(本地仓库路径,镜像)
找到解压路径下的conf的目录,进入目录,找到settings.xml文件,将文件拷贝到C:\Users\Administrator\.m2目录下,打开settings.xml,找到 如下两个地方:
1.<!-- 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>D:\maven\repo</localRepository><!-- 自定义maven仓库的位置,如果不设置那么默认存储在${user.home}/.m2/repository下 -->
2. <mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror><!-- 配置镜像,降低中心仓库的负载 -->
<id>UK</id>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
这样maven就安装好了。
相关文章推荐
- Windows上Maven3.x的安装
- eclipse配置maven环境
- Maven之——环境搭建
- Maven的安装
- Maven学习笔记一:安装和基本配置
- maven安装
- 使用Eclipse-Maven-git做Java开发(2)--安装maven
- maven简单安装过程
- Maven的安装及配置
- Maven 安装配置
- Maven基础篇之安装与目录结构
- Maven的安装和配置
- Maven安装以及环境配置(Windows)
- maven安装
- Maven Installation
- eclipse安装maven插件
- Maven安装及EclipseMaven插件安装
- eclipse link安装插件,看不到安装的工具
- 安装maven所见错误No plugin found for prefix 'help' in the current project and in the plugin
- Maven中央存储库