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. $使用dom4j可解析 返回&#x等字样的 html转义字符【转】

    如果以GET或POST请求某个系统返回,带有 $#x 那很有可能是axis服务器返回的. <?xml version="1.0" encoding="UTF-8&q ...

  2. CSS选择器之基本选择器

    一.通用选择器 选择器 * 匹配 所有元素 最低支持CSS版本 2 二.类型选择器 选择器 <元素类型> 匹配 所有指定类型的元素 最低支持CSS版本 1 三.类选择器 选择器 <类 ...

  3. 第18月第22天 机器学习first

    1.网易公开课 机器学习   http://open.163.com/special/opencourse/machinelearning.html https://github.com/search ...

  4. 使用css将图像居中

    默认情况下,图像属于内联元素.这意味着它们与周围的文本一起流动.为使图像居中,我们应该将其转换成块级元素,通过将display属性的值设置为block就可以完成转换. <html> < ...

  5. IOS中的用户安全

    用户安全: 原则:在网络传输过程中,关于用户的密码是不能传递明文的,需要通过加密之后进行传递, 一般采用的加密技术是: (1)md5+盐 (2)hmac+md5 (3)hmac+md5+时间戳   这 ...

  6. 使用SSH远程登陆Linux

    ⒈SSH介绍 SSH(Secure Shell)由IETF的网络工作小组(NetWork Working Group)所制定,SSH是建立在应用层和传输层基础上的安全协议. SSH是目前较可靠,专为远 ...

  7. jquery开发自定义的插件总结

    1.第一种方式,有元素的插件 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...

  8. 攻击者利用的Windows命令、横向渗透工具分析结果列表

    横向渗透工具分析结果列表 https://jpcertcc.github.io/ToolAnalysisResultSheet/ 攻击者利用的Windows命令 https://blogs.jpcer ...

  9. 根据txt中的文件名将文件复制到目标文件夹中

    功能如标题,之所以这么做是有的时候文件数目较多,一个一个复制太复杂了,代码如下: # -*- coding:utf-8 -*- #2018_03_18 #实现功能:根据文件名字将对应的文件复制到目标地 ...

  10. c# WinFo判断当前程序是否已经启动或存在的几种方式

    第一种方式:利用Mutex互斥量实现同时只有一个进程实例在运行 static class Program { /// <summary> /// 应用程序的主入口点. /// </s ...