本文共 2532 字,大约阅读时间需要 8 分钟。
1、操作系统:Windows 10
2、nexus版本:nexus-3.0.1-01-win641、下载地址:
安装成功后有两个默认账号admin、anonymous,其中admin具有全部权限默认密码admin123;anonymous作为匿名用户,只具有查看权限。
pepositories说明
maven-central:maven中央库,默认从拉取jar
maven-releases:私库发行版jar maven-snapshots:私库快照(调试版本)jar maven-public:仓库分组,把上面三个仓库组合在一起对外提供服务,在本地maven基础配置settings.xml中使用。
本地maven库配置settings.xml
org.sonatype.plugins nexus admin admin123 nexus * http://localhost:8081/repository/maven-public/ repo2 central Human Readable Name for this Mirror. http://repo2.maven.org/maven2/ nexus central http://central true true central http://central true true nexus
工程配置pox.xml
nexus Releases http://localhost:8081/repository/maven-releases nexus Snapshot http://localhost:8081/repository/maven-snapshots
compile page org.apache.maven.plugins maven-surefire-plugin true org.apache.maven.plugins maven-compiler-plugin 3.3 1.8 1.8
编译到maven私库
deploy -e
项目右单击->Run As->Maven build.. 进入如下界面快照编译:pom.xml中版本设置
0.0.1-SNAPSHOT
编译后在nexus中看到如下图结果,快照已经编译到nexus中Components-> maven-snapshots。
发行版编译:pom.xml中版本设置
0.0.1-RELEASE
编译后在nexus中看到如下图结果,发行版已经编译到nexus中Components->maven-releases。