美文网首页
mac 安装 nexus maven

mac 安装 nexus maven

作者: cain07 | 来源:发表于2025-07-27 16:26 被阅读0次

1. 下载

2. 安装

设置全局变量

echo 'export PATH="/Users/apple/Documents/Evn/nexus-3.79.1/nexus-3.79.1-04/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile

3. 启动

启动nexus服务

nexus start`

打开http://localhost:8081/ 访问nexus主页

4. 使用

nexus 相关命令:

./nexus start

./nexus stop

./nexus restart

./nexus status

4.1

新搭建的neuxs环境只是一个空的仓库,需要手动和远程中心库进行同步。
nexus默认是关闭远程索引下载,最重要的一件事情就是开启远程索引下载。

4.2 仓库类型介绍:

仓库相关配置
maven仓库类型只有3中,分别是: hosted、proxy、group

hosted:宿主类型 内部项目的发布仓库,专门用来存储我们自己生成的jar文件
proxy:代理类型 从远程中央仓库中寻找数据的仓库,如可配置阿里云maven仓库
group:组类型 组仓库用来方便我们开发人员进行设置的仓库
简单来说: group = hosted+proxy

版本类型
release:专用于部署发布版本的jar
snapshot:专用于部署快照版本的jar,jar都是以-SNAPSHOT结尾,pom中version需以-SNAPSHOT(必须大写)结尾
mixed:可包含release和snapshot版本

4.3 在maven中配置自己的私服

1. aliyun
http://maven.aliyun.com/nexus/content/groups/public
2. gradle
https://plugins.gradle.org/m2/
2. apache_snapshot
https://repository.apache.org/content/repositories/snapshots/
3. apache_release
https://repository.apache.org/content/repositories/releases/
4. atlassian
https://maven.atlassian.com/content/repositories/atlassian-public/
5. central.maven.org
http://central.maven.org/maven2/
6. datanucleus
http://www.datanucleus.org/downloads/maven2
7. maven-central (安装后自带,仅需设置Cache有效期即可)
https://repo1.maven.org/maven2/
8. nexus.axiomalaska.com
http://nexus.axiomalaska.com/nexus/content/repositories/public
9. oss.sonatype.org
https://oss.sonatype.org/content/repositories/snapshots
10.pentaho
https://public.nexus.pentaho.org/content/groups/omni/

5. 报错解决

问题1:Nexus was not configured with an encryption key and is using the Default key.

https://blog.csdn.net/tb_problem/article/details/143426224

问题2:

./nexus: line 15: realpath: command not found
./nexus: line 21: realpath: command not found
./nexus: line 24: realpath: command not found
required property 'karaf.data' undefined, check ./nexus.vmoptions   

国内镜像可以安装成功

brew install coreutils 

相关文章

网友评论

      本文标题:mac 安装 nexus maven

      本文链接:https://www.haomeiwen.com/subject/gtbobjtx.html