使用NEXUS搭建MAVEN私服
一、安装
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄
1.下载地址:https://www.sonatype.com/nexus-repository-oss,ZIP版
2.下载完后,将文件解压,存放到一个目录中。下载完成后,直接将下载后的压缩文件进行解压,存放在磁盘的某个目录下即可
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。3.将nexus-2.14.12-02\bin 写入系统环境变量的path下
4.修改配置文件 bin/jsw/conf/wrapper.conf,wrapper.java.command=c:\xxx\java1.xxx\bin\java(java的路径)
5.nexus install安装成WINDOWS服务
6.nexus start启动nexus服务
二、添加三方jar包
1.打开localhost:8080/nexus, 使用admin/admin123登录
2.切换到3rd part上,artifact页签上,上传jar包
3.切换到browser index页签上,找到需要使用的jar包,COPY对应的MAVEN信息到项目的POM文件中
三、MAVEN的配置
打开maven/conf/settings.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>c:\maven\repositories</localRepository> <pluginGroups></pluginGroups> <proxies></proxies> <servers> <server> <id>nexus-releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers> <mirrors></mirrors> <profiles> <profile> <id>center</id> <repositories> <repository> <id>nexus</id> <name>nexus</name> <url>http://localhost:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>nexus</name> <url>http://localhost:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>center</activeProfile> </activeProfiles> </settings>

更多精彩