本文简单介绍使用配置maven使用nexus仓库,在团队中使用nexus,避免每个人都从中央仓库去下载依赖,节省带宽,提高下载速度,同时也减少了中央仓库的压力

配置在maven中使用nexus很简单(我们假设nexus安装在本地):

1.在maven的配置文件settings.xml中的profiles节点下添加如下内容

<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://localhost:8081/nexus/content/groups/public</url>
</repository>
</repositories>
</profile>
<profile>
<id>nexus-snapshots</id>
<repositories>
<repository>
<id>nexus-snapshots</id>
<name>local private nexus snapshots</name>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
</repository>
</repositories>
</profile>

2.在servers节点下添加如下内容:

        <server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server> <server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>

如果需要要在maven中把jar包发布到nexus,则需要在项目的pom.xml文件里配置以下内容,然后运行 mvn deploy

    <distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

配置maven使用nexus的更多相关文章

  1. 配置maven访问nexus,配置项目pom.xml以发布maven项目到nexus中

    maven访问nexus有三种配置方法,分别为: 项目pom.xml,优先级最高: user的settings.xml,优先级中,未在pom.xml中配置repository标签,则使用这个配置: m ...

  2. 安装配置maven私服-nexus

    1.ubuntu下的Bundle安装方式 1.1. 去官网下载安装包:http://www.sonatype.org/nexus/ 我这里下载的是:nexus-2.8.1-01-bundle.zip, ...

  3. Maven仓库Nexus的安装配置

    1.下载nexus,最新版本是nexus-2.8.0-05   参考文章 下载nexus-latest-bundle.zip文件后,并解压到  D:\nexus下 配置nexus的环境变量:先配置NE ...

  4. maven私服nexus搭建(windows)

    1.下载nexus 地址:https://www.sonatype.com/download-oss-sonatype 下载相应版本的zip包. 2.安装nexus 下载完成后,解压到本地任意目录. ...

  5. 持续集成之三:Maven私服Nexus使用

    环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80 apache-tomcat-7.0.90 mysql-5.7.23 ...

  6. 07 Maven 使用Nexus创建私服

    7. Maven 使用Nexus创建私服 私服不是 Maven 的核心概念,它仅仅是一种衍生出来的特殊的 Maven 仓库.通过建立自己的私服,就可以降低中央仓库负荷.节省外网带宽.加速 Maven ...

  7. 使用Nexus配置Maven私有仓库

    使用Nexus配置Maven私有仓库 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.安装配置Nexus 1>.下载nexus 下载地址:https://www.sonat ...

  8. 配置maven从自己的私服下载jar包nexus、maven私服仓库(二)

    配置maven项目从私服下载jar包 pom文件配置从maven私服下载jar包 settings文件配置从maven私服下载jar包 (方便自己关键字搜索,所以多写了几行o(* ̄︶ ̄*)o) 今天自 ...

  9. Linux安装配置maven以及搭建nexus私服(编写启动脚本)

    2011年07月12日16:32  下面介绍在Linux操作系统下安装配置maven和搭建nexus私服. 一.安装前的准备 下载 jdk http://www.oracle.com/technetw ...

随机推荐

  1. Linux系统分区方案建议

    在安装Linux系统之初,就应该考虑怎样使linux系统得到最好的性能.linux本身也设计为可以良好扩展的形态. 笔者建议系统程序和业务程序分离安装比较合理,笔者所在的公司也是按照这种理念实施的.比 ...

  2. ubuntu rails3.2.16 提示gem mysql adapter

    把database.yml的adapter改为mysql2 把Gemfile文件中的gem mysql改为gem mysql2

  3. js匹配浏览器类型,收藏下

    <script type="text/javascript">/** 智能机浏览器版本信息:**/  varbrowser={    versions:function ...

  4. [oracle] 重要服务启动与停止命令行

    ① 控制台服务[em control] 启动:emctl start dbconsole 停止:emctl stop dbconsole ② 监听器服务[listener control] 启动:ls ...

  5. C语言中带参数的宏

    带参数的宏定义有如下的格式: [#define 指令----带参数的宏] #define 标识符(x1,x2,……,xn) 其中  x1,x2,……xn是标志符(宏的参数) 注意:在宏的名字和括号之间 ...

  6. Qt 线程基础(QThread、QtConcurrent等)

    [-] 使用线程 何时使用其他技术替代线程 应该使用 Qt 线程的哪种技术 Qt线程基础 QObject与线程 使用互斥量保护数据的完整 使用事件循环防止数据破坏 处理异步执行 昨晚看Qt的Manua ...

  7. selenium测试(Java)--学习总结

  8. e555. 在Applet中播放音频

    // See also e551 精简的Applet public void init() { // Load audio clip AudioClip ac = getAudioClip(getDo ...

  9. 转)x264重要结构体详细说明(2): x264_image_t、x264_picture_t、x264_nal_t

    转自:http://nkwavelet.blog.163.com/blog/static/2277560382013102923912753/ /*************************** ...

  10. [渗透技巧] Windows命令行下载

    certutil简介 用于证书管理 支持环境: XP  -  Windows 10 全系统 更多:https://technet.microsoft.com/zh-cn/library/cc75534 ...