Nexus私服setting.xml配置

前端之家收集整理的这篇文章主要介绍了Nexus私服setting.xml配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

环境信息:
Windows:Windows 7
Maven:3.2.3

setting.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">

  <!-- 本地仓库存储位置,默认为${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> -->

  <pluginGroups>

  </pluginGroups>  

  <proxies>

  </proxies>

  <!-- 发布的服务器及对应的用户名和密码-->
  <servers>   
    <server>  
        <id>releases</id>
        <username>admin</username>  
       <password>admin123</password>  
     </server>  
     <server>  
        <id>snapshots</id>  
        <username>admin</username>  
        <password>admin123</password>  
     </server>
    <server>  
        <id>thirdparty</id>  
        <username>admin</username>  
        <password>admin123</password>  
     </server>

  </servers>

  <mirrors>   
    <!-- 给nexus repository创建mirror镜像,-->
    <mirror>   
      <id>nexus</id>
      <mirrorOf>central</mirrorOf>   
      <url>http://192.168.33.107:8081/nexus/content/groups/public</url>   
    </mirror>   
    <!-- 配置其他镜像-->  
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
    <mirror>  
        <id>repo2</id>  
        <mirrorOf>central</mirrorOf>  
        <name>Human Readable Name for this Mirror.</name>  
        <url>http://repo2.maven.org/maven2/</url>  
    </mirror>
  </mirrors>

  <profiles>     
      <profile>  
        <id>nexus-profile</id>
        <activation>
          <jdk>1.7</jdk>
        </activation> 
        <repositories>  
          <!-- nexus仓库配置-->
          <repository>  
            <!-- repository唯一标识-->
            <id>nexus</id>  
            <!-- repository名称-->
            <name>local private nexus</name>  
            <!-- repository URL-->
            <url>http://192.168.33.107:8081/nexus/content/groups/public</url>  
            <!-- 表示可以从这个仓库下载releases版本的构件--> 
            <releases>
              <enabled>true</enabled>
            </releases>  
            <!-- 表示可以从这个仓库下载snapshots版本的构件--> 
            <snapshots>
              <enabled>true</enabled>
            </snapshots>  
          </repository>  
        </repositories> 
        <pluginRepositories>  
          <!-- nexus插件仓库配置-->
          <pluginRepository>  
            <id>nexus</id>  
            <name>local private nexus</name>  
            <url>http://192.168.33.107:8081/nexus/content/groups/public</url>  
            <releases>
              <enabled>true</enabled>
            </releases>  
            <snapshots>
              <enabled>true</enabled>
            </snapshots>  
          </pluginRepository>  
        </pluginRepositories>  
    </profile>    
  </profiles> 
  <!--激活私库信息的配置-->  
  <activeProfiles>  
      <activeProfile>nexus-profile</activeProfile>      
  </activeProfiles>  
</settings>

猜你在找的XML相关文章