【Maven】安装配置

来源:互联网 发布:adams软件下载 编辑:程序博客网 时间:2024/06/05 22:59

想要安装 Apache Maven 在Windows 系统上, 需要下载 Maven 的 zip 文件,并将其解压到你想安装的目录为了使它工作,你必须声明在 Maven 的配置文件中设置代理服务器:settings.xml.

1. Maven配置文件

找到文件 {M2_HOME}/conf/settings.xml, 并把你的代理服务器信息配置写入。注:{M2_HOME}  => D:\software\yiibai.com\apache-maven

配置alimaven镜像

[html] view plain copy
 print?
  1. <mirrors>  
  2.     <!-- mirror  
  3.      | Specifies a repository mirror site to use instead of a given repository. The repository that  
  4.      | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used  
  5.      | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.  
  6.      |  
  7.     <mirror>  
  8.       <id>mirrorId</id>  
  9.       <mirrorOf>repositoryId</mirrorOf>  
  10.       <name>Human Readable Name for this Mirror.</name>  
  11.       <url>http://my.repository.com/repo/path</url>  
  12.     </mirror>  
  13.      -->  
  14.  <mirror>  
  15.       <id>alimaven</id>  
  16.       <name>aliyun maven</name>  
  17.       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
  18.       <mirrorOf>central</mirrorOf>          
  19.     </mirror>  
  20.   </mirrors>