1、Nexus 配置 Maven 代理仓库

默认情况,Nexus 只配置了中央厂库的代理,且不能上传快照版本的组件。我们这里创建一个新的本地厂库,并添加更多的代理地址,解决部分组件下载不到和无法上传快照版本组件问题。

最新版本的Nexus默认密码需要去安装服务获取:

[root@nexus nexus-3.17.0-01]# cat /home/sonatype-work/nexus3/admin.password

添加更多第三方Maven仓库代理:

点击“Create Repository”按钮,进入仓库类型列表,选择“maven2 (proxy)”

填写Name和远程地址,根据远程Maven厂库情况进行相应的设置,完成添加。

推荐Maven仓库:

Name Version Policy Romote Sotrage URL
Aliyun Mixed http://maven.aliyun.com/nexus/content/groups/public/
Apache-Releases Release https://repository.apache.org/content/repositories/releases/
Atlassian Release https://maven.atlassian.com/content/repositories/atlassian-public/
Atlassian-3rd-P-Old Release https://maven.atlassian.com/3rdparty/
Atlassian-Packages Release https://packages.atlassian.com/maven-public/
BeDataDriven Release https://nexus.bedatadriven.com/content/repositories/public/
Clojars Release http://clojars.org/repo/
Geomajas Release http://maven.geomajas.org/
Hortonworks Release http://repo.hortonworks.com/content/repositories/releases/
JBoss-Public Mixed http://repository.jboss.org/nexus/content/groups/public/
JBoss-Releases Release https://repository.jboss.org/nexus/content/repositories/releases/
JBoss-EA Release https://repository.jboss.org/nexus/content/repositories/ea/
JCenter Release http://jcenter.bintray.com/
Jenkins-Releases Release http://repo.jenkins-ci.org/releases/
Jfrog Snapshot http://oss.jfrog.org/artifactory/oss-snapshot-local/
Nuxeo Release https://maven-eu.nuxeo.org/nexus/content/repositories/public-releases/
Pentaho-omni Release https://public.nexus.pentaho.org/content/groups/omni/
Shibboleth Release https://build.shibboleth.net/nexus/content/repositories/releases/
Smartbear Release http://smartbearsoftware.com/repository/maven2/
Spring-Lib-M Release http://repo.spring.io/libs-milestone/
Spring-Lib-Release Release http://repo.spring.io/libs-release/
Spring-Plugins Release http://repo.spring.io/plugins-release/
WSO2-Public Release http://maven.wso2.org/nexus/content/repositories/public/
WSO2-Releases Release http://maven.wso2.org/nexus/content/repositories/releases/
XWiki-Releases Release http://maven.xwiki.org/releases/

2、Nexus 配置 Maven 本地仓库

为了能上传快照版本的组件,需要添加一个本地Maven仓库:

点击“Create Repository”按钮,进入仓库类型列表,选择“maven2 (hosted)”

参数
Name maven-hosted
Version Policy Mixed
Layout Policy Strict
Blob Store default
Deployment Policy Allow redeploy
Clean Policy None

保存后可在Repository列表看到新增的Repository:

作者:Jeebiz  创建时间:2019-10-13 14:18
 更新时间:2024-01-08 11:42