Nexus安装

  nexus安装,可以参照:【Maven】Nexus(Maven仓库私服)下载与安装

Nexus简单说明

  •  用途:指定私服的中央地址、将自己的Maven项目指定到私服地址、从私服下载中央库的项目索引、从私服仓库下载依赖组件、将第三方项目jar上传到私服供其他项目组使用
  • 仓库:

      hosted   类型的仓库,内部项目的发布仓库 

      releases 内部的模块中release模块的发布仓库

      snapshots 发布内部的SNAPSHOT模块的仓库  

      3rd party 第三方依赖的仓库,这个数据通常是由内部人员自行下载之后发布上去 

      proxy   类型的仓库,从远程中央仓库中寻找数据的仓库

      group   类型的仓库,组仓库用来方便我们开发人员进行设置的仓库

      

Nexus配置

  nexus配置大部分使用默认配置即可,主要是配置一个项目索引

  选择Central仓库,设置Download Remote Indexes:True

  

Nexus使用

  •   项目使用nexus私服的jar包,在项目的pom.xml文件中指定私服仓库

     <repositories>
    <repository>
    <id>nexus</id>
    <name>nexus</name>
    <url>http://192.168.1.103:8081/nexus/content/groups/public/</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    </repositories>
  •   项目使用nexus私服的插件,在项目的pom.xml文件中指定插件仓库
     <pluginRepositories>
    <pluginRepository>
    <id>nexus</id>
    <name>nexus</name>
    <url>http://192.168.1.103:8081/nexus/content/groups/public/</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </pluginRepository>
    </pluginRepositories>
  •   如果想本机所有的maven项目都使用私服的组件,可以在maven的设置文件settings.xml中添加属性,并激活
     <profiles>
    <profile>
    <id>nexusProfile</id>
    <repositories>
    <repository>
    <id>nexus</id>
    <name>nexus</name>
    <url>http://192.168.1.103:8081/nexus/content/groups/public/</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    </repositories>
    </profile>
    </profiles>
    <!-- 激活 -->
    <activeProfiles>
    <activeProfile>nexusProfile</activeProfile>
    </activeProfiles>
  • 项目发布到私服,maven项目使用命令:mvn clean deploy;需要在pom文件中配置一下代码;
     <distributionManagement>
    <repository>
    <id>user-release</id>
    <name>User Project Release</name>
    <url>http://192.168.1.103:8081/nexus/content/repositories/releases/</url>
    </repository> <snapshotRepository>
    <id>user-snapshots</id>
    <name>User Project SNAPSHOTS</name>
    <url>http://192.168.1.103:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
    </distributionManagement>

    注意还需要配置mvn发布的权限,否则会报401错误,在settings.xml中配置权限,其中id要与pom文件中的id一致

     <server>
    <id>user-release</id>
    <username>admin</username>
    <password>admin123</password>
    </server>
    <server>
    <id>user-snapshots</id>
    <username>admin</username>
    <password>admin123</password>
    </server>

    发布成功后,可以在nexus中看到

    

  • 上传第三方的jar包,选择3rd party-->Artifact Upload--> 选择GAV方式-->填好构建参数-->增加jar包-->上传,在Browse Storeage查看

  

  

【Maven】Nexus配置和使用的更多相关文章

  1. maven+nexus配置本地私有仓库

    以下是settting.xml的配置 <?xml version="1.0" encoding="UTF-8"?> <settings> ...

  2. Maven nexus安装、配置和使用

    简介         Nexus 可以代理并缓存 Maven 构件,当 Maven 需要下载构件的时候,就不需要反复的请求中央仓库. 有些公司都不提供外网给项目组人员,因此就不能使用 Maven 访问 ...

  3. 架构(二)Maven安装以及Nexus配置

    一 Maven安装配置 1.1 下载 http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-ma ...

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

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

  5. Nexus Repository3安装和maven,npm配置(Linux)

    Nexus Repository下载 根据操作系统选择指定版本,本文针对Linux安装,其他的安装过程可能有所差异. https://help.sonatype.com/repomanager3/do ...

  6. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(二)

    前言     上一篇随笔Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)介绍maven和nexus的环境搭建,以及如何使用maven和nexus统一管理库 ...

  7. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)

    前言     但凡一个略有规模的项目都需要一个持续集成环境的支撑,为什么需要持续集成环境,我们来看一个例子.假如一个项目,由A.B两位程序员来协作开发,A负责前端模块,B负责后端模块,前端依赖后端.A ...

  8. 国内可用maven repository 配置

    国内可用maven repository 配置 发表于2016/1/4 23:08:04  10235人阅读 分类: maven 鉴于一些原因,从maven中央仓库download依赖包时,被各种折磨 ...

  9. maven的安装,maven库配置和Eclipse插件的安装

    maven的安装,maven库配置和Eclipse插件的安装 1.下载并解压maven 2.配置环境变量 3.配置maven配置文件 1.下载链接 Downloading Apache Maven 2 ...

随机推荐

  1. Linux开机挂载windows共享文件夹

    https://blog.csdn.net/zhaogang1993/article/details/79573271  (可行) 命令: mount -t cifs -o username=&quo ...

  2. shiro用authc配置后登录成功后不能跳转到index页面

    转自:https://ydoing.iteye.com/blog/2248188

  3. UI5-文档-4.36-Device Adaptation

    现在,我们根据运行应用程序的设备配置控件的可见性和属性.通过使用sap.ui.设备API和定义一个设备模型,我们将使应用程序在许多设备上看起来很棒. Preview On phone devices, ...

  4. 修改默认的inout输入框背景颜色

    https://www.cnblogs.com/beileixinqing/p/6119690.html

  5. spring中的BeanFactory和FactoryBean的区别与联系

    首先,这俩都是个接口… 实现 BeanFactory 接口的类表明此类是一个工厂,作用就是配置.新建.管理 各种Bean. 而 实现 FactoryBean 的类表明此类也是一个Bean,类型为工厂B ...

  6. cmd 命令相关

    计算相关进程数: tasklist|find /i "cmd.exe" 安装git的可以 tasklist|find /i "cmd.exe"  | wc -l

  7. git的一些常用操作命令

    这些操作命令都是从廖雪峰老师的官网上看过后记下来的,以下是廖雪峰老师的官网,大家可以看看,教程不错~ http://www.liaoxuefeng.com/wiki/00137395163059296 ...

  8. Unity即将内置骨骼动画插件Anima2D

    Unity一直在寻找新的方法来帮助开发者,并为他们提供最好的工具.在此我们向大家宣布,Unity将内置流行的骨骼动画插件Anima2D,从2017年1月开始免费供所有Unity开发者使用! 同时也欢迎 ...

  9. 转)MySQL日期与时间函数

    -- MySQL日期时间处理函数 -- 当前日期:2017-05-12(突然发现今天512,是不是会拉防空警报) SELECT NOW() FROM DUAL;-- 当前日期时间:2017-05-12 ...

  10. Appium原理初步--Android自动化测试学习历程

    章节:自动化基础篇——Appium原理初步(第七讲) 本期关键词: Appium.跨语言跨平台.Bootstrap 主要讲解内容及笔记: 一.what is appium 一种封装了uiautomat ...