Maven配置

下载地址:https://maven.apache.org

settings.xml配置

<?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:\m2\repository</localRepository>
  <proxies>
    <proxy>
      <id>normal</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>deployment</username>
      <password>deploy123</password>
      <host>10.0.0.13</host>
      <port>8081</port>
      <nonProxyHosts>10.0.0.13</nonProxyHosts>
    </proxy>
  </proxies>
  <servers> 
    <server>
       <id>nexus-releases</id>
       <username>deployment</username>
       <password>deploy123</password>
     </server>
     <server>
       <id>nexus-snapshots</id>
       <username>deployment</username>
       <password>deploy123</password>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <!--This is used to direct the public snapshots repo in the 
          profile below over to a different nexus group -->
      <id>nexus-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf>
      <url>http://10.0.0.13:8081/nexus/content/groups/public-snapshots</url>
    </mirror>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://10.0.0.13:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  
  <profiles>
    <profile>
      <id>development</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    <profile>
      <!--this profile will allow snapshots to be searched when activated-->
      <id>public-snapshots</id>
      <repositories>
        <repository>
          <id>public-snapshots</id>
          <url>http://public-snapshots</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>public-snapshots</id>
          <url>http://public-snapshots</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>development</activeProfile>
  </activeProfiles>
</settings>

配置环境变量

set MAVEN_HOME = D:\apache-maven-3.3.9
set Path = %Path%;%MAVEN_HOME%\bin

测试

mvn -version
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,293评论 19 139
  • 1.先去官网下载maven,在安装配置 简单讲下maven的安装步骤: 1.在安装maven之前,先确保已经安装J...
    莫寻Moxun阅读 4,288评论 0 0
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,014评论 6 342
  • 1.下载maven,https://maven.apache.org/download.cgi 2.将maven解...
    Hugh1029阅读 3,177评论 0 0
  • 1.创建数组的方式 1.1字面量 1.2构造函数(了解) 2.检测数组 3.数组的方法 3.1.1增加(改变数组的...
    程本超阅读 1,618评论 1 1