Maven私服搭建(管理jar包依赖的JavaEE Web系统):
企业会以公司为单位,新建一个maven的私服,这里面放本公司所有的jar文件
所有的程序员都通过maven连接公司的私服进行项目的管理
-- eclipse(maven) ----> 公司的私服下载jar包 ----> 去maven中心库下载
nexus下载地址:http://www.sonatype.org/nexus/
1. 安装私服(公司的maven服务器 ,放全公司的jar包,以及项目生命周期中要使用到的各种插件)。
a. 解压nexus-2.8.0-05-bundle.zip。
nexus-2.8.0-05:核心目录。
-- bin\jsw: 存放了操作Nexus应用的命令。
-- conf : nexus.properties 配置文件可更改port、host、nexus-work、runtime。
sonatype-work : 工作目录。
-- sonatype-work\nexus\storage:所有仓库存储目录
b. 配置启动nexus应用
nexus-2.10.0-02\bin\jsw\windows-x86-64:
- console-nexus.bat : 控制台运行nexus
- start-nexus.bat: 启动nexus服务
- stop-nexus.bat: 停止nexus服务
- install-nexus.bat : 安装nexus到window服务中
- uninstall-nexus.bat:从window服务中删除nexus
cmd启动nexus: sc start nexus-webapp
cmd停止nexus: sc stop nexus-webapp
2. nexus应用使用。
a. 启动进入Nexus主界面:
- http://localhost:8081/nexus/index.html
b. 登录Nexus:admin/admin123
c. 点击左边菜单Repositories查看所有仓库:
- Public Repositories:仓库组。
- 3rd party:第三方的仓库。
- Maven Central:Maven中央仓库。
- Releases:发行版存放仓库。
- Snapshots:快照版存放仓库。 (测试版本还没有到达最终版本)
- fkjava Central: 自定义的仓库。
说明:四种类型的仓库:group(组)、proxy(代理)、hosted(本地)、virtual(虚拟)
d. 创建自己的仓库。
-- Add按钮后在configuration选项中进行配置.
3.私服的启动 从cmd直接cd进入到安装目录nexus-2.10.0-02\bin\jsw\下选择自己的操作系统 我的是 H:\nexus-2.10.0-02\bin\jsw\windows-x86-64 然后输入console-nexus.bat就启动了 可以运行http://127.0.0.1:8081/nexus/进行访问