Nexus恢復誤刪除的倉庫

  • 2019 年 11 月 6 日
  • 筆記

前提條件是:沒有清空trash.

首先登陸到nexus所在的機器,找到sonatype-work這個目錄,這個是nexus的數據目錄,所以有jar包和索引等都存放在這裡.

切換到sonatype-work/nexus/trash 這個目錄,就可以看到你剛才刪除的倉庫名字了,

比如我剛才刪除的是3rd party, 這裡會顯示一個thirdparty,

這個是倉庫的ID,創建的時候要用到的.

1、把thirdparty這個目錄移到sonatype-work/nexus/storage/ 裡面,

移之前確認一下storage裡面是不是還有thirdparty這個目錄,如果有,(備份)刪除掉之後再移.

2、重新添加下。

nexus-1.png

3、這個ID、Name在sonatype-work/nexus/conf/nexus.xml 也能查到

nexus-2.png

4、save下

5、設置為公共倉庫

nexus-3.png

save就行了。