nexus nexus mvnrepositoryy 删除了库怎么恢复

Sonatype Nexus 库被删除的恢复方法
时间: 22:05:04
来自于:https://my.oschina.net/u/178116/blog/519840
今天在公司Maven私服的时候,不把Release库删掉了。冒出来了!公司所有的积累都没了啊,里闪过第一个办法就是看是否有回收站,恰Nexus UI中看到了一个叫Trash...的功能。可是我点击后发现只有Empty Trash的功能,这要按下去还啊。千万不能按啊!
最后在Sonatype Nexus官方搜索到一篇文章,原文如下:
When you delete a repository from the Nexus UI, nexus will remove the repository from any groups it belongs too and move the repository contents to it's trash folder. Sometimes you will want to restore this repository back into service.
To restore a deleted repository with id of 'releases':
1. mv sonatype-work/nexus/trash/releases sonatype-work/storage so that you end up with sonatype-work/storage/releases2. Recreate the repository with the same repository id 'releases' using the repositories tab user interface.3. Add the repository to any groups that it was in before.
The act of creating the repository in the UI will force a reindex of the previous repository storage contents.
!找到了被删除文件恢复的办法。最后按照官方所提供的办法成功地恢复了被删Release库下所有的数据。操作步骤如下:
首先找到sonatype-work/nexus/trash 下找到你删除的库,并保存到其他地方;
然后通过nexus控制台点击Add,选择Hosted Repository,然后输入被删除的Repository信息;
把保存的库文件copy到指定的sonatype-work/nexus/storage/[releases]下即可;
点击列表中的Public Repositories,然后在的Configuration标签下将Releases添加到Ordered Group Repositories中;
最后Save保存就可以了。
$T.total > 0 && $T.page <= $T.pageNum}
{#foreach $T.data as r}
{$T.r.formt_tm}{#if $T.r.nickname}{#else}匿名{#/if}
{$T.r.content}
{#if $T.page > 1 && $T.pageNum > 1)
$T.s_num > 2}
{#for index = $T.s_num to $T.e_num}
$T.pageNum > $T.pageNavSize+ 2 && $T.s_num != $T.pageNum - $T.pageNavSize}
{#if $T.pageNum > 1}
{#if $T.pageNum != $T.page && $T.pageNum > 1}
<a href="javascript:void(0);" page="{$T.page 下一页
您的回应...
也许你感兴趣
(window.slotbydup=window.slotbydup || []).push({
id: '3465635',
container: s,
size: '120,240',
display: 'float'
(C)2012 本站提供的内容来源于广大网络用户,我们不保证内容的正确性。如果转载了您的内容,希望删除的请联系我们!Sonatype Nexus 库被删除的恢复方法
时间: 16:06:25
&&&& 阅读:533
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&今天在整理公司Maven私服的时候,不小心把Release库删掉了。瞬间冒出冷汗来了!公司所有的积累都没了啊,脑子里闪过第一个办法就是看是否有回收站,恰好在Nexus UI中看到了一个叫Trash...的功能。可是我点击后发现只有Empty Trash的功能,这要按下去还得了啊。
&&&&最后在Sonatype Nexus官方搜索到一篇文章,原文如下:
When you delete a repository from the Nexus UI, nexus will remove the repository from any groups it belongs too and move the repository contents to it‘s trash folder. Sometimes you will want to restore this repository back into service.
To restore a deleted repository with id of ‘releases‘:
1. mv sonatype-work/nexus/trash/releases sonatype-work/storage so that you end up with sonatype-work/storage/releases2. Recreate the repository with the same repository id ‘releases‘ using the repositories tab user interface.3. Add the repository to any groups that it was in before.
The act of creating the repository in the UI will force a reindex of the previous repository storage contents.
& & 幸好!找到了被删除文件恢复的办法。最后按照官方所提供的办法成功地恢复了被删Release库下所有的数据。操作步骤如下:
首先找到sonatype-work/nexus/trash 下找到你删除的库,并保存到其他地方;
然后通过nexus控制台点击Add,选择Hosted Repository,然后输入被删除的Repository信息;
把刚才保存的库文件copy到指定的sonatype-work/nexus/storage/[releases]下即可;
点击列表中的Public Repositories,然后在下方的Configuration标签下将Releases添加到Ordered Group Repositories中;
最后Save保存就可以了。
标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&原文:http://my.oschina.net/u/178116/blog/519840
教程昨日排行
&&国之画&&&& &&&&&&
&& &&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!2017年8月 Java大版内专家分月排行榜第三2017年4月 Java大版内专家分月排行榜第三2016年3月 Java大版内专家分月排行榜第三
本帖子已过去太久远了,不再提供回复功能。在使用maven是,因内外网限制往往需要配置自由的maven库,小编看见网上教程数不胜数,遍主动试试
以下是下载地址 :
/download-oss-sonatype
小编因为选择了3.0 & 呵呵呵,这是一个坑,后续再说,先上图:
maven的版本无论是公司库还是等等比较常见的都是2.x & 3.0版本是2016年4月才出来的,改善了很多体验,如可自动安装等优先,不用在像2.x版本去手动选择了,而且目前是自动部署,安装一步一步点击就到了如下界面、
登陆界面就不说了用户名:admin & ,密码 &admin123 & ,感觉界面是不是更好看了点小编是这样觉得的 。但是是不是感觉找不到方向了,是啊完全和2.x不一样了,宝宝想哭,宝宝,找不到方向了。但是repository没错吧 ,对就在那,大胆的点进去吧,然后再点进去吧,如图:
是不是感觉不一样了 ,是啊怎么是这样了,大致的住参数没变,但是为什么很多2.x有的选项现在,没有了,下载索引呢? &宝宝找不到,宝宝好伤心,一个一个试呗,也就有了下面的结果
请原谅小编的命名不规范,但这是失败的试验品,最终的结果是去搜索界面仍然不能搜索出来,无赖下小编切换了2.x然后大功告成!!!!对不起大家了,但是小编不会放弃的小编会继续研究在后续的博客更新,但是毕竟是新产品有坑也是正常的 ,但是还是小编太傻,找不到。
有兴趣的朋友也来一起琢磨一下吧,怕麻烦的还是乖乖2.x & 吧 & ,thanks
阅读(...) 评论()使用Nexus Repository搭建属于自己公司的私有maven服务器 | 张明云的博客
在Android应用开发过程中,不同IDE对工程的依赖方式不一样:
使用Eclipse开发时,项目之间的依赖关系是这样的:一个主工程(project)可以依赖多个libproject、so、jar包,对jar包和so的依赖是直接将jar和so放在工程的libs文件夹下(老版本的ADT需要手动配置Build Path),对libproject的依赖呈现在工程的“project.properties”文件中。
使用Android Studio开发时,除了可以依赖module(对应Eclipse中的libproject)、jar和so,还可以依赖aar(aar和jar包不同之处在于可以将so和资源文件一起打包),as的依赖关系全部(jar、so、aar、libproject)在build.gradle文件中的android标签中管理。
使用AS开发应用时,除了可以依赖本地的库之外,还可以依赖网上(公有maven服务器、私有maven服务器、jcenter等),如果是依赖本地的,必须要将依赖的module和主工程放在一个project里面,这就导致了每个project都需要配置这些依赖关系,如果是公司内多个工程依赖同一个公司内部的控件,控件有更新时,同步非常麻烦,但公司内部的控件不可能部署到公有maven服务器上,所以有必要搭建一个局域网内的maven服务器,方便管理公司内部的公共库。
maven私有服务器搭建
搭建maven私服使用得比较多的是Nexus,Nexus是基于maven仓库管理的社区项目,主要的使用场景就是可以在局域网搭建一个maven私服,用来部署第三方公共构件或者作为远程仓库在该局域网的一个代理。
关于Nexus的介绍和配置很简单,具体可以查看这里:。
上传库到私服
上传库到私服有两种方式,一种是库中配置,配置完成后执行upload这个task,另外一种方式是直接上传。下面分别对这两种方式做介绍:
在库中配置,步骤如下:
1. 在project下的gradle.properties文件中定义通用属性,方便如果有多个库需要部署时,不需要修改每一个库中的配置:
URLMAVEN_URL= http://172.28.1.*:8081/nexus/content/repositories/thirdparty/
MAVEN_SNAPSHOT_URL = http://172.28.1.*:8081/nexus/content/repositories/thirdparty-snapshot/
#对应maven的groupId值
GROUP=common
#登录nexus oss的用户名
NEXUS_USERNAME=admin
#登录nexus oss的密码
NEXUS_PASSWORD=admin123
GROUP_ID = common
TYPE = aar
# description
DESCRIPTION = dependences lib
2. 修改module对应的build.gradle文件,配置以谁的名义上传这个库,上传到什么地方,这个库叫什么名字,属于哪个group,ID和version、description、packageing等信息
apply plugin: 'com.android.library'
apply plugin: 'maven'
compileSdkVersion 17
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
versionCode 1
versionName "1.0"
buildTypes {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
sourceSets {
jniLibs.srcDirs = ['libs']
lintOptions {
abortOnError false
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
uploadArchives {
configuration = configurations.archives
repositories {
mavenDeployer {
snapshotRepository(url: MAVEN_SNAPSHOT_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
repository(url: MAVEN_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
pom.project {
version '1.0.0'
artifactId 'TestLibrary'
groupId GROUP_ID
packaging TYPE
description DESCRIPTION
artifacts {
archives file('TestLibrary.aar') }
3. 打开Gradle projects(在AS的右边栏),找到对应的module,展开,找到Tasks下面的upload标签并双击,在Gradle Console标签可以查看是否上传成功。
直接上传:直接上传很简单,直接按照下图的箭头操作即可,如果上传aar还没有研究过,有兴趣的可以自己研究一下:
在项目中使用私有仓库
在项目中使用私有仓库的步骤如下:
1. 在project的build.gradle文件中指定私有仓库的地址,like this:
2. 在需要依赖私有仓库的build.gradle文件中设置依赖关系:

我要回帖

更多关于 nexus repository官网 的文章

 

随机推荐