maven私仓搭建——nexus3
本文主要介绍maven私仓在windows下的搭建。
本文主要参考:http://www.cnblogs.com/bingyeh/p/5913486.html
好,下面上货。
1、下载nexus3==>https://www.sonatype.com/download-oss-sonatype。

下载windows版本。

2、解压到本地的任意文件夹下。


然后进入nexus-3.3.2-02\bin文件夹下。
在当前文件夹下开启命令行,执行如下命令:
nexus intall

然后进入windows的服务管理页面,能够看到nexus已经成为系统服务了。

使用命令nexus start 启动服务。使用命令 nexus stop 结束服务。

3、进入nexus页面:
http://localhost:8081/

4、使用管理员用户登录:
用户名:admin
密码:admin123

5、进入后新建仓库:

这里需要解释一下我们需要的仓库类型。
我们需要一个代理仓库从网上下载安装包,需要一个release仓库保存已经发布的上线的安装包,还需要一个snapshot用来保存快照的私仓。
最后,这些私仓需要一个统一的访问入口,就是私仓组。

6、分别看一下这几个私仓的配置:
proxy私仓,使用的外部私仓是阿里的仓库http://maven.aliyun.com/nexus/content/groups/public:

release私仓:

snapshot私仓:

group私仓组:

7、如何在项目中使用。

首先需要使用自定义的settings文件,并且在项目中使用新的maven配置。

     <?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">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
--> <!-- pluginGroups
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|-->
<pluginGroups>
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups> <proxies>
</proxies> <servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers> <mirrors> <mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://192.168.0.120:8081/repository/nexus-public/</url>
</mirror>
</mirrors> <profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<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> </profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>

然后,还需要在pom文件中指定要上传的私仓名称,在pom文件最后添加如下内容。

 <distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://192.168.0.120:8081/repository/nexus-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://192.168.0.120:8081/repository/nexus-snapshots</url>
</snapshotRepository>
</distributionManagement>

这样,在使用mavendeploy上传jar包的时候,就能够根据当前的版本上传到release或者snapshot上了。

8、查看私仓是否上传成功。

然后就可以到那个仓库下寻找你要找的,刚刚生成的jar 包。

maven私仓搭建——nexus3的更多相关文章

  1. 【Maven】---Linux搭建Nexus3.X私服

    Linux搭建Nexus3.X私服 备注:linux版本: ubuntu 同时已经部署好JDK8环境 一.linux安装nexus 1.创建文件夹并进入该目录 cd /usr/local && ...

  2. Maven私仓配置

    <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://mav ...

  3. 回收maven私仓过期垃圾

    login->scheduled tasks->add

  4. 不一样的go语言-athens私仓安装

    前言   本系列文章曾多次提及go的依赖管理,提到了私仓,构件系统等概念,也曾提及当前流行的go构件系统,如athens,jfrog artifactory.鉴于jfrog的收费特性,本文只选择ath ...

  5. 如何搭建自己的Maven远程私仓

    1.首先,配置好Maven,jdk等必备环境 2.配置好环境后,下载最新版本的nexus 下载地址:http://www.sonatype.org/nexus/go 3.打开目录nexus-***\b ...

  6. maven私库nexus2.3.0-04迁移升级到nexus-3.16.1-02(异机迁移备份)

    环境信息: nexus2.3.0-04安装在32位Windows server 2003系统上 安装位置信息如下: 仓库迁移 Nexus的构件仓库都保存在sonatype-work目录中,nexus2 ...

  7. Maven deploy部署jar包到远程私仓

    Maven deploy部署jar包到远程私仓 maven deploy介绍 maven中的仓库分为两种,snapshot快照仓库和release发布仓库.snapshot快照仓库用于保存开发过程中的 ...

  8. 纯净CentOS搭建harbor镜像私仓

    物理宿主机IP:  192.168.1.4 在官网下载 CentOS-7-x86_64-DVD-1810 用Hyper-v建立一代虚机,安装时遇分辨率问题无法继续,需要在选择启动界面按TAB键以编辑启 ...

  9. kubernetes配置secret拉取私仓镜像

    2017.05.10 19:48* 字数 390 阅读 5216评论 0喜欢 8 对于公司内部的项目, 我们不可能使用公有开放的镜像仓库, 一般情况可能会花钱买docker私仓服务, 或者说自己在服务 ...

随机推荐

  1. Selenium下Chrome配置

    地址:https://peter.sh/experiments/chromium-command-line-switches/ chrome_options.add_argument('--headl ...

  2. CTF—攻防练习之HTTP—命令注入

    主机:192.168.32.152 靶机:192.168.32.167 首先nmap,nikto -host,dirb 探测robots.txt目录下 在/nothing目录中,查看源码发现pass ...

  3. Python面试-websocket及web框架

    一.Websocket 1. websocket概念 在讲websocket之前,我们先来看看ajax轮询和long poll的实现机制. A.  ajax轮询 ajax轮询的原理非常简单,让浏览器隔 ...

  4. 网页制作入门——HTML(2)编码与字符实体

    在上一期,我们顺口提到了——你写的网页在打开后,可能发现只是一串乱码.那么这是为什么呢? 这就是编码的神奇力量! 八卦的启示——什么是编码? 编码的思想,很早就在中国诞生了,从还不太明朗的结绳记事.算 ...

  5. 图解DMZ

    图解DMZ 1. 概念介绍 DMZ是英文“demilitarized zone”的缩写,中文译为“隔离区”.“非军事区”.它是为了解决安装防火墙后外部网络不能访问内部网络服务器的问题,而设立的一个非安 ...

  6. cm日志的清理

    #过一段时间后,cm server的空间越来越大 #删除日志/bin/rm /var/lib/cloudera-host-monitor/ts/*/partition*/* -rf/bin/rm /v ...

  7. vim 文档加密

    众所周知vim的加密方法是 :X 解密为输入:X后直接回车两次 注意此时必须使用:wq来保存,:x和shift+zz(ZZ)均无法保存此更改 此时注意 :wq"与":x" ...

  8. (4.16)mysql备份还原——物理备份之XtraBackup实践

    关键词:XtraBackup实践,物理备份,xtrabackup备份,innobackupex备份 [1]如何使用? [3]系列:innobackupex --help |more [4]系列:xtr ...

  9. 如何重装mysql8及初次修改密码

    首先在设置里卸载旧版的mysql 然后把你之前的安装的mysql文件夹整个删掉 然后删除注册表的MySQL信息 安装新版的MySQL 新建并配置my-default.ini文件 如下: [mysqld ...

  10. Kick Start 2019 Round A Parcels

    题目大意 $R \times C$ 的网格,格子间的距离取曼哈顿距离.有些格子是邮局.现在可以把至多一个不是邮局的格子变成邮局,问每个格子到最近的邮局的曼哈顿距离的最大值最小是多少. 数据范围 $ 1 ...