一、入门 1、下载并解压nexus文件 2、运行nexusin exus.exe /run 3、浏览器输入localhost:8081 4、登录用户名admin,密码在E:sonatype-work exus3admin.password 5、更改密码 6、nexus配置文件nexusetc exus-default.properties 二、上传jar包到私服 1、settings.xml <servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers> 2、pom.xml <distributionManagement> <repository> <id>releases</id> <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> 3、项目运行mvn deploy命令 三、从私服下载jar包 1、settings.xml <profiles> <profile> <id>dev</id> <repositories> <repository> <id>nexus</id> <url>http://127.0.0.1:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>public</id> <name>Public Repositories</name> <url>http://127.0.0.1:8081/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles> 四、安装第三方jar包到本地仓库 mvn install:install-file -DgroupId=com.wuxi -DartifactId=practice -Dversion=1.1.1 -Dpackaging=jar -Dfile=jarPath 五、安装第三方jar包到私服 1、settings.xml <servers> <server> <id>thirdparty</id> <username>admin</username> <password>admin123</password> </server> </servers> 2、项目运行命令 mvn deploy:deploy-file -DgroupId=com.wuxi -DartifactId=practice -Dversion=1.1.1 -Dpackaging=jar -Dfile=jarPath -Durl=http://127.0.0.1:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty