Linux服务器使用六:搭建自己的Sonatype Nexus Maven私有库
2016-12-04 20:32
447 查看
一、安装Sonatype Nexus
1、下载最新版的Sonatype Nexus并上传到linux服务器2、拷贝并解压
cp nexus-latest-bundle.tar.gz /home/dfz/ mkdir nexus tar -zxvf nexus-latest-bundle.tar.gz -C nexus
3、编辑nexus脚本,配置参数
vi /home/dfz/nexus/nexus-2.14.1-01/bin/nexus #配置以下内容 RUN_AS_USER=root
4、启动nexus服务
./nexus start
访问http://Your-IP:8081/nexus/
即可进入管理页面
默认账户为:admin,默认密码为:admin123
二、Maven端配置
1、在本地库的配置文件setting.xml中加入以下配置:<server> <!-- 部署账户密码 --> <id>nexus-releases</id> <username>deployment</username> <password>deployment123</password> </server> <server> <!-- 部署账户密码 --> <id>nexus-snapshots</id> <username>deployment</username> <password>deployment123</password> </server> <profile> <id>dfz</id> <activation> <activeByDefault>false</activeByDefault> <jdk>1.7</jdk> </activation> <!-- 配置私有库 --> <repositories> <repository> <id>nexus</id> <url>http://10.0.0.111:8081/nexus/content/groups/public/</url> <releases> <enable>true</enable> </releases> <snapshots> <enable>true</enable> </snapshots> </repository> </repositories> <!-- 配置插件库 --> <pluginRepositories> <pluginRepository> <id>nexus</id> <url>http://10.0.0.111:8081/nexus/content/groups/public/</url> <releases> <enable>true</enable> </releases> <snapshots> <enable>true</enable> </snapshots> </pluginRepository> </pluginRepositories> </profile> <activeProfiles> <activeProfile>dfz</activeProfile> </activeProfiles>
2、在项目的pom.xml文件中加入
<distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://10.0.0.111:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus SnapShot Repository</name> <url>http://10.0.0.111:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
完成私有库搭建
相关文章推荐
- 使用 PHP 搭建自己的视频点播网站,第 1 部分:基础工作-(1)
- 使用NOWSMS搭建自己的彩信中心
- 使用Google搭建自己的SVN或Git或Mercurial代码服务器之完美教程
- 搭建自己的SIP服务器:开源sip服务器opensips的搭建及终端TwInkle的使用
- 搭建自己的SIP服务器:开源sip服务器opensips的搭建及终端TwInkle的使用
- 使用DynamipsGUI搭建自己的网络测试环境
- 使用Spring Tool Suite搭建spring mvc+mybatis框架的自己总结
- 如何使用花生壳让别人访问自己搭建的FTP服务器
- 使用XBMC搭建自己的媒体中心
- 使用Google-Project-Hosting搭建自己的网络SVN服务器
- 使用VS2008+SVN插件配合Google Code搭建自己的开源项目管理
- 使用Xapian搭建自己的搜索引擎
- 使用CruiseControl搭建自己的持续集成环境
- 完全免费!!使用dot.tk和Sina SAE服务免费搭建自己的网站
- U盘安装CentOS5.6(用退休的笔记本搭建自己的Linux服务器)
- 使用 PHP 搭建自己的视频点播网站
- 使用CruiseControl搭建自己的持续集成环境
- 搭建自己的小型监控系统——开始使用
- svn的使用(自己搭建服务器+使用eclipse的svn插件)
- 使用dedecms搭建自己的本地网站(全程图解)