maven私仓搭建——nexus3
来源:互联网 发布:python中tile函数 编辑:程序博客网 时间:2024/04/27 15:27
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 包。
阅读全文
0 0
- maven私仓搭建——nexus3
- 使用Nexus3搭建Maven私服
- Maven+nexus3服务器搭建(linux)
- Maven私服Nexus3.X搭建
- 使用Nexus3搭建Maven私服
- Linux下搭建maven私服nexus3.x
- Linux下搭建Maven私服Nexus3.X
- Linux环境使用Nexus3搭建Maven私服
- maven私服nexus3搭建和使用
- Nexus3搭建Maven私有库(一)
- Nexus3搭建Maven私有库(二)
- Nexus3搭建Maven私有库(三)
- Nexus3搭建Maven私有库(四)
- Nexus3搭建Maven私有库(五)
- Linux搭建maven私服nexus3.5
- Centos7 搭建最新 Nexus3 Maven 私服
- Centos7 搭建最新 Nexus3 Maven 私服
- Nexus3.xx私服搭建
- RecyclerView横向滑动没停止时竖向不能滑动冲突
- 关于eclipse部署到tomcat的项目可正常访问,而单独打包为.war放在tomcat的webapps下的项目无法正常访问的解决思路
- 改变Select三角样式
- 通信系统仿真
- 【旧资料整理】菜单栏文字背景变白的有效解决方法
- maven私仓搭建——nexus3
- 安卓调用JS All WebView methods must be called on the same thread
- 六.自定义realm进行授权(包括散列认证)
- 我所经历过的tcp“粘包”及其处理
- 如何通过Word 2013发布CSDN博客
- 【旧资料整理】MFC--边栏(CDialogBar)不能获得输入焦点问题的解决办法
- SEI CERT C安全编码-信号(SIG)
- 实验七 TCP 协议的拥塞控制机制观察
- 修复JLink V8