maven私仓搭建——nexus3
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的更多相关文章
- 【Maven】---Linux搭建Nexus3.X私服
Linux搭建Nexus3.X私服 备注:linux版本: ubuntu 同时已经部署好JDK8环境 一.linux安装nexus 1.创建文件夹并进入该目录 cd /usr/local && ...
- Maven私仓配置
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://mav ...
- 回收maven私仓过期垃圾
login->scheduled tasks->add
- 不一样的go语言-athens私仓安装
前言 本系列文章曾多次提及go的依赖管理,提到了私仓,构件系统等概念,也曾提及当前流行的go构件系统,如athens,jfrog artifactory.鉴于jfrog的收费特性,本文只选择ath ...
- 如何搭建自己的Maven远程私仓
1.首先,配置好Maven,jdk等必备环境 2.配置好环境后,下载最新版本的nexus 下载地址:http://www.sonatype.org/nexus/go 3.打开目录nexus-***\b ...
- maven私库nexus2.3.0-04迁移升级到nexus-3.16.1-02(异机迁移备份)
环境信息: nexus2.3.0-04安装在32位Windows server 2003系统上 安装位置信息如下: 仓库迁移 Nexus的构件仓库都保存在sonatype-work目录中,nexus2 ...
- Maven deploy部署jar包到远程私仓
Maven deploy部署jar包到远程私仓 maven deploy介绍 maven中的仓库分为两种,snapshot快照仓库和release发布仓库.snapshot快照仓库用于保存开发过程中的 ...
- 纯净CentOS搭建harbor镜像私仓
物理宿主机IP: 192.168.1.4 在官网下载 CentOS-7-x86_64-DVD-1810 用Hyper-v建立一代虚机,安装时遇分辨率问题无法继续,需要在选择启动界面按TAB键以编辑启 ...
- kubernetes配置secret拉取私仓镜像
2017.05.10 19:48* 字数 390 阅读 5216评论 0喜欢 8 对于公司内部的项目, 我们不可能使用公有开放的镜像仓库, 一般情况可能会花钱买docker私仓服务, 或者说自己在服务 ...
随机推荐
- 创建podspec文件,为自己的项目添加pod支持
Cocoapods作为iOS开发的包管理器,给我们的开发带来了极大的便利,而且越来越多的第三方类库支持Pod,可以通过Pod傻瓜式的集成到自己的工程中,那么问题来了,我自己也有一系列的小工具类,怎么让 ...
- XSS攻击总结
本文由 http://www.cnblogs.com/phpstudy2015-6/p/6767032.html 整理总结而来 XSS又称CSS(cross site script),译为跨站脚本攻击 ...
- LinuxC/C++基础——引用
1.引用(Reference) 1.1引用的基本语法 引用是C++对C的重要扩充,也存在与其他一些编程语言中,并不是C++的发明.通过引用,C++增加了 另外一种给函数传递地址的途径,这就是按引用传递 ...
- Linux C/C++基础——二级指针做形参
1.二级指针做形参 #include<stdio.h> #include<stdlib.h> void fun(int **temp) { *temp=(int*)malloc ...
- 【DSP开发】解读TI的KeyStone II云技术应用
最近,德州仪器(TI)公司推出6款最新KeyStone II多核SoC,助力云应用.TI公司多核DSP中国市场开发经理蒋亚坚先生向媒体讲解了这6款KeyStone II新产品的特点与目标应用. ...
- C++学习笔记-C++对C语言的函数拓展
内联函数 内联函数是指用inline关键字修饰的函数.在类内定义的函数被默认成内联函数.内联函数从源代码层看,有函数的结构,而在编译后,却不具备函数的性质 inline关键字只是给编译器一个建议,编译 ...
- 简单的利用nginx部署前端项目
网上有很多教程写的一大堆东西,新手可能会有点看不懂,现在我写这篇文章是为了更好的帮助新手,如何将自己的前端项目部署到自己的服务器上. 首先我们必须要有一台自己的ubuntu服务器,如果没有可以去阿里云 ...
- weiphp记录
jae 上传必须包括这2个文件,不然又会重新安装 标志文件有两个:Application/Install/Data/install.lockApplication/User/Conf/config.p ...
- 论文阅读 | BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chain
BadNets: 识别机器学习模型供应链中的漏洞 摘要 基于深度学习的技术已经在各种各样的识别和分类任务上取得了最先进的性能.然而,这些网络通常训练起来非常昂贵,需要在许多gpu上进行数周的计算;因此 ...
- [转] c++加载外部库文件探究
首先介绍:用#import导入dll和用#pragma comment导入lib还有在程序中LoadLibrary加载dll有什么区别 (1) #import导入的dll是com组建的dll,主要用来 ...