nexus 组件下载和上传
一、 重写 super pom
修改 maven 的 settings.xml
Configuring Maven to Use a Single Repository Group
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<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>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
补充:
目的是只使用nexus
http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html
二、修改项目中pom文件
1. 指定仓库
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
2. 设置部署
项目中pom.xml文件
<distributionManagement>
<repository>
<id>user-releases</id>
<name>user-releases</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository> <snapshotRepository>
<id>user-snapshots</id>
<name>user-snapshots</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
maven的setting.xml
<servers>
<server>
<id>user-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>user-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
补充:
目的是 mvn clean deploy 时自动部署到私服
http://maven.apache.org/ref/3.0.4/maven-model/maven.html#class_distributionManagement
关于部署到 repository OR snapshotRepository
查询资料
Prepare a Release
Preparing a release goes through the following release phases: Check that there are no uncommitted changes in the sources
Check that there are no SNAPSHOT dependencies
Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
Transform the SCM information in the POM to include the final destination of the tag
Run the project tests against the modified POMs to confirm everything is in working order
Commit the modified POMs
Tag the code in the SCM with a version name (this will be prompted for)
Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
Commit the modified POMs
实际测试
<version>0.0.1-SNAPSHOT</version>
版本号加-SNAPSHOT 会自动部署到Snapshots仓库,格式必须为 【版本号-SNAPSHOT】
生的jar包自动添加时间戳 例如:0.0.1-20160315.073435-1.jar
去掉-SNAPSHOT 则会部署到releases 仓库
http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html
三、手动上传组件
1. 登录nexus
2. 选择目标仓库
3. 选择Tab [Artifact Upload]
4. 完善组件信息
备注:Snapshots 仓库不能手动上传
四、设置代理
1. 登录nexus
2. 进入仓库管理添加代理
五、仓库类型
group、hosted、proxy、virtual
group由三类组成
宿主再分三类
代理一开始有3个
http://books.sonatype.com/nexus-book/reference/confignx-sect-manage-repo.html
六、删除私服中的组件
右键删除即可
七、查找并使用组件
登录 nexus
search
就看到组件坐标了
nexus 组件下载和上传的更多相关文章
- 从Nexus私服下载和上传资源(一)
从私服中下载资源 首先要明确将资源下载到哪里 找到maven 配置文件settings.xml 文件,添加如下配置:1.添加镜像配置:将所有访问外网仓库的请求指向私服: <mirror> ...
- 从Nexus私服下载和上传资源(二)
上传资源到私服 当项目完成后如果需要deploy 部署jar 包到私服,则可以添加如下配置: 1.在项目的 pom.xml 文件中添加上传部署的路径: 注意:如果需要对 releases版本进行多次部 ...
- 重新想象 Windows 8 Store Apps (66) - 后台任务: 下载和上传
[源码下载] 重新想象 Windows 8 Store Apps (66) - 后台任务: 下载和上传 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 后台任务 后台 ...
- 重新想象 Windows 8.1 Store Apps (91) - 后台任务的新特性: 下载和上传的新特性, 程序启动前预下载网络资源, 后台任务的其它新特性
[源码下载] 重新想象 Windows 8.1 Store Apps (91) - 后台任务的新特性: 下载和上传的新特性, 程序启动前预下载网络资源, 后台任务的其它新特性 作者:webabcd 介 ...
- github下载和上传项目
git下载和上传项目 下载: git clone +地址 上传: 1.git init 在当前项目的目录中生成本地的git管理(多一个.git文件夹,为隐藏文件) 2.git add .(注意最后面有 ...
- 使用MFC提供的Http类下载和上传文件
1.下载文件 Download(const CString& strFileURLInServer, //待下载文件的URL const CString & strFileLocalF ...
- 2.4 利用FTP服务器下载和上传目录
利用FTP服务器下载目录 import os,sys from ftplib import FTP from mimetypes import guess_type nonpassive = Fals ...
- 2.3 利用FTP服务器下载和上传文件
二.利用FTP服务器的下载文件 from ftplib import FTP from os.path import exists def getfile(file,site,dir,user=(), ...
- 在XShell中使用sz和rz命令下载和上传文件
借助XShell,使用linux命令sz可以很方便的将服务器上的文件下载到本地,使用rz命令则是把本地文件上传到服务器 工具/原料 XShell CentOS 6.5 使用sz下载文件 1 输 ...
随机推荐
- javascript中this之说
this是在运行时基于函数的执行环境绑定的:在全局函数中,this等于window,而当函数被作为某个对象的方法调用时,this等于那个对象.不过,匿名函数的执行环境具有全局性,因此其this对象通常 ...
- zabbix超级乱码解决问题
个人而言,网上那些方法并不顶什么用,研究了一番总结出了自己的一个方法. 像这种,出现了严重乱码,也不是像网上说的那样把楷体复制过去就好.事实证明我复制过去好多次了,然而并没有什么用. 下面是我自己总结 ...
- LIS问题(DP解法)---poj1631
题目链接:http://poj.org/problem?id=1631 这个题题目有些难看懂hhh,但实质就是求LIS--longest increasing sequence. 以下介绍LIS的解法 ...
- Python repr() 函数
Python repr() 函数 Python 内置函数 描述 repr() 函数将对象转化为供解释器读取的形式. 语法 以下是 repr() 方法的语法: repr(object) 参数 obje ...
- DFT
离散傅里叶变换(Discrete Fourier Transform,缩写为DFT),是傅里叶变换在时域和频域上都呈离散的形式, 将信号的时域采样变换为其DTFT的频域采样.在形式上,变换两端(时域和 ...
- 网页中引用优酷视频去广告自动播放代码[xyytit]
很多时候需要在网站中加入视频,可视频太大放自己服务器上太占空间,可以把视频上传到优酷网上,这样节省了空间,打开速度方面也会有不少提升.下面教大家如何引用自动播放的优酷视频.把下面的代码加在你网页适当位 ...
- 给出一个十六进制的数0xFF 0x80 (只有2“位”) 将其转换成有符号的一字节的十进制整数
#include <stdio.h>#include<iostream>#include <stdlib.h>#include<string.h>usi ...
- C/C++堆、栈及静态数据区详解
转自:https://www.cnblogs.com/hanyonglu/archive/2011/04/12/2014212.html 做略微修改 C/C++堆.栈及静态数据区详解 本文介绍C ...
- MongoDB使用场景和局限 (转)
MongoDB的使用场景: 1.Web应用程序.文档能表示丰富的数据结构,建模相同数据库所需的集合数量通常会比使用完全正规化关系型数据库的数据表数量要少.动态查询和二级索引能让你轻松的实现SQL开发者 ...
- Maven+eclipse快速入门
1.eclipse下载 在无外网情况下,无法通过eclipse自带的help-install new software输入url来获取maven插件,因此可以用集成了maven插件的免安装eclips ...