https://www.jianshu.com/p/7a09915675d9

或许用得上。

settings.xml

<server>      <!-- 服务器密码 -->
     <id>user-release</id>
     <username>admin</username>
     <password>admin123</password>
   </server>
   <server>
     <id>user-snapshots</id>
     <username>admin</username>
     <password>admin123</password>
   </server>
</servers>

<!-- 配置私服地址映射 -->
<mirror>
       <id>nexus</id>
       <mirrorOf>*</mirrorOf>
       <name>MyRepository</name>
       <!--私服仓库地址-->
       <url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>

<profile>
        <id>nexus</id>
        <repositories>
            <repository>
                <id>central</id>
                <name>MyRepository</name>
                <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>

  <!-- 激活私服映射 -->
  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

pom.xml

<!-- 镜像加速 -->
<repositories>
    <repository>
        <id>nexus</id>
        <name>nexus</name>
            <url>http://localhost:8081/nexus/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
</repositories>

<!-- 镜像发布 -->
<distributionManagement>
      <repository>
        <!-- 两个ID必须与 setting.xml中的<server><id>nexus-releases</id></server>保持一致-->
          <id>user-release</id>
          <name>User Project Release</name>
          <url>http://localhost:8081/nexus/content/repositories/releases/</url>
        </repository>  

     <snapshotRepository>
        <id>user-snapshots</id>
         <name>User Project SNAPSHOTS</name>
         <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
       </snapshotRepository>
</distributionManagement>  

nexus私服常用设置的更多相关文章

  1. Linux 安装配置maven3.0 以及搭建nexus私服

    http://carvin.iteye.com/blog/785365 一.软件准备 1.apache-maven-3.0-bin.tar.gz 下载地址:http://www.apache.org/ ...

  2. Linux 搭建 nexus 私服【转】

    原文:https://yq.aliyun.com/articles/5981 第8章 私服nexus 本章详细介绍了nexus的安装过程,设置maven从私服下载构件,以及发布构件至nexus. 8. ...

  3. Maven项目的打包发布到Nexus私服和服务器

    1.编写pom文件如下: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins< ...

  4. 使用mvn命令将pom和jar上传至nexus私服

    要将自定义的jar或者pom上传至nexus私服,需要配置maven的settings文件! 上传至nexus私服配置 1. settings配置 <!-- maven设置私服对应的信息:id. ...

  5. nexus私服update repair index索引失败解决方案(转)

    转载地址:http://blog.csdn.net/first_sight/article/details/51559086 问题描述: 搭建Maven的Nexus私服仓库,一般安装完Nexus后,默 ...

  6. linux 搭建 nexus 私服及配置

    安装篇 1.tar -zxvf nexus-latest-bundle.tar.gz 2.cd nexus-2.13.0-01/bin 3../nexus start 这时可能提示 ********* ...

  7. Linux下建立Nexus私服

    Linux下建立Nexus私服 要安装3个东西,然后配置私服: 1.JDK 2.Maven 3.Nexus 然后配置 1.JDK的安装 下载JDK安装包,格式为RPM格式,安装即可 安装程序 #rpm ...

  8. Linux_Centos中搭建nexus私服

    1.在Linux下搭建Nexus私服 1).下载并且解压      下载  nexus-2.11.2-03-bundle.zip      unzip nexus-2.11.2-03-bundle.z ...

  9. Window下Nexus私服搭建

    项目组大部分人员不能访问maven的central repository,因此在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到这台私服上  环境是:nexus-2.1.1.mav ...

随机推荐

  1. 《超哥带你学Linux》

    前言 “Linux?听说是一个操作系统,好用吗?” “我也不知道呀,和windows有什么区别?我能在Linux上玩LOL吗” “别提了,我用过Linux,就是黑乎乎一个屏幕,鼠标也不能用,不停地的敲 ...

  2. Oracle语句优先级

    SQL> SELECT SAL SALARY FROM EMP WHERE SALARY<2500;Warning: connection was lost and re-establis ...

  3. Python基础(函数部分)-day04

    写在前面 上课第四天,打卡: 加勒比海盗今天上映:端午节公司发的粽子很有范! 一.函数的基本概念 - 函数是什么?  函数,就是一个'锤子',一个具有特定功能的'锤子',使用者可以在适当的时候使用这个 ...

  4. 20155332 2016-2017-2 《Java程序设计》第9周学习总结

    20155332 2016-2017-2 <Java程序设计>第9周学习总结 教材学习内容总结 了解JDBC架构 掌握JDBC架构 掌握反射与ClassLoader 了解自定义泛型和自定义 ...

  5. 20155231 2016-2017-2 《Java程序设计》第6周学习总结

    20155231 2016-2017-2 <Java程序设计>第6周学习总结 教材学习内容总结 学习目标 理解流与IO 理解InputStream/OutPutStream的继承架构 理解 ...

  6. PhoneUtil

    package cn.fraudmetrix.octopus.horai.biz.utils; import org.springframework.util.StringUtils; import ...

  7. JS堆栈与拷贝

    一.堆栈的定义 1.栈是一种特殊的线性表.其特殊性在于限定插入和删除数据元素的操作只能在线性表的一端进行. 结论:后进先出(Last In First Out),简称为LIFO线性表.栈的应用有:数制 ...

  8. include的作用

    #include发生在预处理阶段,整个编译链接过程,#include是最简单的了,没有之一.就是在include的位置直接把文件原原本本完完整整一字不落的包含进来,下面举一个极端点的例子: //fil ...

  9. D - Maximizing Advertising

    题目链接:https://cn.vjudge.net/contest/250168#problem/D 题目大意:给你一些点的坐标,这些点属于两个帮派,让你将这些点分进两个不能重叠的矩形中,问你最多两 ...

  10. mysql 案例~关于pt-osc工具的用途

    简介:今天咱们聊聊PT-OSC的东东一 简单介绍  1 标准组合   pt-online-schema-change --user= --password= --host= D=,t= --sock= ...