加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Nexus私服setting.xml配置

发布时间:2020-12-16 08:22:41 所属栏目:百科 来源:网络整理
导读:环境信息: 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 = "ht

环境信息:
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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读