Nexus 是 Maven 仓库管理器。
下载地址:Download Nexus Repository OSS | Sonatype
1.解压压缩包
2.安装
nexus-2.12.0-01\bin目录,然后使用nexus.bat install命令进行操作(管理员身份运行),出现如图所示说明安装好了.
3.启动
-
任务管理器启动
-
命令启动
输入命令:nexus.bat start
4.访问
访问地址:http://localhost:8081/nexus
右上角登录
用户名:admin
密码:admin123
文件目录对应库
转载地址:手把手教你快速搭建私服环境-CSDN博客
5.卸载
输入命令:nexus.bat uninstall
6.部署失败、上传失败
原因:部署失败,可能是因为pom.xml里面没有<distributionManagement>节点,可能是因为私服路径不正确,我这里检查后发现是是因为第一个原因,所以检查mavn的setting.xml的server和profile。
mavn的setting.xml如下
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>E:\localRepository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>gongsi-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>gongsi-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>gongsi</id>
<name>gongsi仓库</name>
<mirrorOf>*</mirrorOf>
<url>http://ip:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>Repository for nexus</name>
<url>http://ip:8081/nexus/content/groups/public/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
<!-- 部署到 nexus 服务器-->
<!-- <distributionManagement>
<!-- <repository>-->
<!-- <id>gongsi-releases</id>-->
<!-- <name>Repository for nexus</name>-->
<!-- <url>http://ip:8081/nexus/content/repositories/releases/</url>-->
<!-- </repository>-->
<!-- <repository>-->
<!-- <id>gongsi-snapshots</id>-->
<!-- <name>Repository for nexus</name>-->
<!-- <url>http://ip:8081/nexus/content/repositories/snapshots/</url>-->
<!-- </repository>-->
<!-- </distributionManagement>-->
备注1:id名称
备注2:设置部署节点,注意是选择snapshots快照方式
完美解决