下载
Download Nexus Repository OSS | Sonatype
Nexus Repository Manager - Software Component Management | Sonatype
通过百度网盘分享的文件:nexus-3.75.1-01-win64.zip
链接:https://pan.baidu.com/s/1PqvL7c5fWXHdnqTES0VHMg?pwd=1234
提取码:1234
查询
nexus.exe --help
nexus.exe /install 安装服务,将程序安装到系统服务列表
nexus.exe /run 运行服务,将程序启动起来(前台线程启动,退出界面即退出程序)
nexus.exe /start 启动服务,将程序以服务的形式启动,将后台调用run进行启动,需等待部分时间完成启动
nexus.exe /stop 停止服务
nexus.exe /status 查看服务状态
nexus.exe /uninstall 卸载服务,在系统服务列表卸载当前服务后,可执行install重新安装
修改端口
etc\nexus-default.properties默认8081
启动
nexus.exe /run
登录
项目发布到私服
登录
修改maven安装目录下的/conf/settings.xml文件
<mirror>
<id>nexus-public</id>
<mirrorOf>*</mirrorOf>
<name>nexus public</name>
<url>http://ip:9007/repository/maven-public/</url>
</mirror>
允许匿名访问不需要配置,ID保持一致
<server>
<id>nexus-public</id>
<username>admin</username>
<password>xxxx</password>
</server>
项目配置
<repositories>
<repository>
<id>nexus-public</id>
<name>nexus public</name>
<url>http://ip/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-public</id>
<name>nexus public</name>
<url>http://ip/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
打包发布
查看资源
上传资源
命令上传
mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<type-of-packaging> \
-Dfile=<path-to-file> \
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
-Durl=<url-of-the-repository-to-deploy>
mvn deploy:deploy-file -DgroupId=commons-io \
-DartifactId=commons-io \
-Dversion=2.15.1 \
-Dpackaging=jar \
-Dfile=/Users/fanshaorong/Desktop/temp/repo/2.15.1/commons-io-2.15.1.jar \
-DrepositoryId=nexus-public \
-Durl=http://xx.xx.xx.xx/repository/maven-public/