eclipse中的maven管理之仓库管理(四)
来源:互联网 发布:淘宝卖家服务热线 编辑:程序博客网 时间:2024/05/02 05:01
一:使用nexus来创建局域网的仓库
1.1下载nexus
1.2解压,并设置bin目录到环境变量
1.3配置nexus的nexus-2.3.1-01\bin\jsw\conf下的wrapper.conf;设置本地java路径;如图
1.4以管理员身份运行cmd.exe,执行nexus install
1.5安装成功后在cmd中执行nexus start
1.6启动成功后在浏览器地址栏访问:http://localhost:8081/nexus/index.html
1.7登录本地的nexus
用户名:admin
密码:admin123
二:创建局域网的仓库
仓库管理:
1.nexus的仓库类型讲解
2.创建私有仓库
2.1添加parent的使用仓库
修改本地maven的配置;setting文件位置:
为已经配置两个仓库添加本地镜像<mirrors> <mirror> <id>central</id> <mirrorOf>*</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://192.168.0.199:8081/nexus/content/groups/public/</url> </mirror>
2.2更新索引,将download Remote Indexes设置为true
保存之后去查看当前任务列表
完成后再进行搜索就可以使用了
2.3删除parent中的工厂设置,在settings.xml中进行工厂的设置
<profiles><profile> <id>central-repos</id> <repositories> <repository> <id>central</id> <name>Central</name> <url>http://central</url> <releases><enable>true</enable></releases> <snapshots><enabled>true</enabled> </snapshots> </repository> </repositories> </profile>
其中url在配置完镜像之后就没有意义了。配置完成之后需要进行激活,开启如下代码
<activeProfiles> <activeProfile>central-repos</activeProfile> </activeProfiles>
2.4项目的发布
然后修改parent的pom.xml文件,添加如下代码:
<distributionManagement> <snapshotRepository> <id>user-snapshots</id> <name>User Project SNAPSHOTS</name> <url>http://192.168.0.199:8081/nexus/content/repositories/MyUserReposSnapshots/</url> </snapshotRepository> <repository> <id>user-releases</id> <name>User Project Release</name> <url>http://192.168.0.199:8081/nexus/content/repositories/MyUserReposRelease/</url> </repository> </distributionManagement>在settings文件上面添加用户信息。给用户指定的权限
<servers> <server> <id>user-snapshots</id> <username>kh</username> <password>123456</password> </server><server> <id>user-releases</id> <username>kh</username> <password>123456</password> </server>
然后在parent的pom.xml上执行maven build 输入或执行clean deploy;
- eclipse中的maven管理之仓库管理(四)
- 《项目管理利器Maven》学习(四):Maven核心之坐标和仓库
- Maven仓库管理之Nexus
- Maven仓库管理之Nexus
- Maven仓库管理之Nexus
- Maven仓库管理之Nexus
- eclipse中的maven管理之插件的配置(六)
- 【maven】Maven仓库管理
- eclipse中的maven管理之聚合与继承和版本的简单管理(三)
- maven项目管理之(一) 中央仓库
- Maven仓库管理-Nexus
- Maven仓库管理-Nexus
- Maven仓库管理-Nexus
- Maven仓库管理-Nexus
- Maven仓库管理
- maven仓库管理
- Maven仓库管理-Nexus
- Maven仓库管理-Nexus
- 软件项目管理总体流程设计
- 第94章、图形变换Matrix(从零开始学Android)
- Hibernate表关系之一对多(inverse详解)
- Linux 标准目录结构
- pat 1034 Head of a Gang
- eclipse中的maven管理之仓库管理(四)
- 用简单英语谈生意-介绍篇
- C++选择目录并定位到默认目录
- 什么是项目管理
- 有序表查找_插值查找
- Volatile深入理解
- 11218 - KTV
- 第95章、手机服务之AudioManager服务(从零开始学Android)
- 《异类》--各章思想整理