下载 Maven,http://maven.apache.org/download.cgi,我用的 apache-maven-3.6.0

配置好环境变量,path 中加入相应路径

聊聊、Maven 私服 Nexus 以及简单使用

 

Linux安装 


下载 Nexus ,这里提供几个网上的网盘资源,官网下载很慢,下面网盘资源分别是:nexus-3.9.0-01-unix.tar.gz、nexus-3.13.0-01-unix.tar.gz

1.

链接: https://pan.baidu.com/s/1p1aYZbK8m7oVXJoE1moNlQ 

提取码: jvam 

2.

链接: https://pan.baidu.com/s/1LjwzEax71H6emkUL3uZRcw

利用 Xshell 上传文件到服务器,这里我用的虚拟机 VMware,首先安装 yum install -y lrzsz,

聊聊、Maven 私服 Nexus 以及简单使用

然后 rz 弹窗,选择 nexus-3.9.0-01-unix.tar.gz、nexus-3.13.0-01-unix.tar.gz 其中一个

聊聊、Maven 私服 Nexus 以及简单使用聊聊、Maven 私服 Nexus 以及简单使用  

聊聊、Maven 私服 Nexus 以及简单使用

聊聊、Maven 私服 Nexus 以及简单使用

上传完毕,解压文件

聊聊、Maven 私服 Nexus 以及简单使用聊聊、Maven 私服 Nexus 以及简单使用

修改配置文件

vim nexus-3.9.0-01/etc/nexus-default.properties,可以修改端口等信息

启动

聊聊、Maven 私服 Nexus 以及简单使用

JDK 版本过低,最少得 1.8,需要更新 JDK,上传 JDK 1.8

 聊聊、Maven 私服 Nexus 以及简单使用

删除 JDK 1.7,首先查找已经安装的 JDK,rpm -qa|grep jdk

聊聊、Maven 私服 Nexus 以及简单使用

安装 JDK 1.8

安装: rpm -ivh *.rpm --force --nodeps

卸载:rpm -e packagename --nodeps

聊聊、Maven 私服 Nexus 以及简单使用 聊聊、Maven 私服 Nexus 以及简单使用

/etc/profile 中添加以下内容

export JAVA_HOME=/usr/java/jdk1.8.0_231-amd64

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

 

source /etc/profile

 

再次启动 Nexus

聊聊、Maven 私服 Nexus 以及简单使用

聊聊、Maven 私服 Nexus 以及简单使用

 

  

Windows安装 


windows版本

链接:https://pan.baidu.com/s/10rHDpSnNHLZpKJCCsMPDNQ
提取码:453c 

 聊聊、Maven 私服 Nexus 以及简单使用

 

选择自己的版本,我这里是 windows-x86-64

聊聊、Maven 私服 Nexus 以及简单使用

启动后,访问  http://127.0.0.1:8081/nexus,进入欢迎页面,实质上这就是一个 web 服务,部署在 jetty 容器里面。

聊聊、Maven 私服 Nexus 以及简单使用

 

简单使用 


nexus仓库: 

- 3rd party:第三方仓库 

- Apache Snapshots:apache 快照仓库 

- Central: maven 中央仓库 

- Releases:私有发布版本仓库 

- Snapshots:私有 快照版本仓库 

 

pom.xml 

<distributionManagement>
<repository>
<id>nexus-release</id>
<name>nexus release</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshot</id>
<name>nexus snapshot</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

 

setting.xml 

<server>
<id>nexus-snapshot</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>nexus-release</id>
<username>deployment</username>
<password>deployment123</password>
</server> 

远程仓库

<mirror>
<id>nexus-repository</id>
<mirrorOf>*</mirrorOf>
<name>nexus repository</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</mirror>

  

相关文章:

  • 2022-01-01
  • 2021-08-12
  • 2021-09-19
  • 2022-01-14
  • 2021-06-25
  • 2021-04-25
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2021-09-15
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-05-26
相关资源
相似解决方案