# 下載
wget https://download.sonatype.com/nexus/oss/nexus-2.14.3-02-bundle.tar.gz
# 解壓
tar -zxvf nexus-2.14.3-02-bundle.tar.gz -C /opt/
# 目錄結構
/opt/nexus-2.14.3-02/ # 程序目錄
/opt/sonatype-work/nexus/ # 數據目錄 (配置、存儲、日志)
cd /opt/nexus-2.14.3-02/bin
# 非 root 啟動 (推薦創建 nexus 用戶)
./nexus start
# 輸出: Starting Nexus OSS... Started Nexus OSS.
# 訪問: https://server-ip:8081/nexus/
# 默認賬號: admin / admin123
注意:root 啟動會報警告,需 export RUN_AS_USER=root 或切換普通用戶。
ojdbc8.jar (Oracle 官網需登錄)。com.oracleojdbc819.3.0.0jar<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>central</mirrorOf>
<name>Nexus Public Mirror</name>
<url>https://nexus-server:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<url>https://nexus-server:8081/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>https://nexus-server:8081/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles><activeProfile>nexus</activeProfile></activeProfiles>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>
| 類型 | 用途 | 示例 |
|---|---|---|
| proxy | 代理遠程倉庫 (中央庫、阿里云) | central, aliyun |
| hosted | 本地存儲 (內部發布、第三方) | releases, snapshots, 3rd party |
| group | 聚合多個倉庫統一對外 | public = central + releases + 3rd party |
/opt/sonatype-work/nexus/storage 異地存儲。deployer 僅有 hosted releases/snapshots 寫權限,開發者僅讀。Remove Snapshots 任務,保留最近 30 天/最多 100 個快照版本。nexus-3.xx.x-xx-unix.tar.gz,需 JDK 11+ (3.40+)。nexus-repository-import-export 插件或手動複製 storage 目錄。