maven 配置nexus私服
来源:互联网 发布:红警找矿软件 编辑:程序博客网 时间:2024/05/21 22:53
一.安装
1.从nexus官网下载nexus-2.12.0-01-bundle.zip,并解压文件放到指定的目录
2.配置nexus环境变量。新建变量:NEXUS_HOME 变量值:D:\Program Files\nexus-2.12.0-01-bundle
3.编辑path,在path路径的后面加上;%NEXUS_HOME%\bin
4.在D:\Program Files\nexus-2.12.0-01-bundle\bin\jsw\windows-x86-64目录下,点击install-nexus 。注:jsw目录下根据自己电脑选择相应的目录
4.启动nexus服务.点击start-nexus启动nexus服务,stop-nexus结束服务
5.在浏览器中打开localhost:8081\nexus,界面如下图:
二.使用
1.在pom.xml中,配置如下代码
<!-- 仓库地址 --> <repositories> <repository> <id>local_nexus</id> <name>local_nexus</name> <url>http://localhost:8081/nexus/content/groups/public</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <!-- 插件地址 --> <pluginRepositories> <pluginRepository> <id>local_nexus</id> <name>local_nexus</name> <url>http://localhost:8081/nexus/content/public</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories>就可以从nexus服务器中下载相应的依赖包。
2.在pom.xml文件中配置如下代码:
<distributionManagement> <repository> <id>local_nexus_releases</id> <name>core Release Repository</name> <url>http://localhost:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>local_nexus_snapshots</id> <name>core Snapshots Repository</name> <url>http://localhost:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>setting.xml中配置:
<server> <id>local_nexus_releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>local_nexus_snapshots</id> <username>admin</username> <password>admin123</password> </server>可以把本地的jar包通过命令部署nexus服务上。
3.以上的可以在setting.xml中的profiles 和activProfiles配置如下内容:
<span style="white-space:pre"></span><profile><span style="white-space:pre"></span><id>local_nexus</id><span style="white-space:pre"></span><repositories><span style="white-space:pre"></span><repository><span style="white-space:pre"></span><id>local_nexus</id><span style="white-space:pre"></span><name>local_nexus</name><span style="white-space:pre"></span><url>http://localhost:8081/nexus/content/groups/public/</url><span style="white-space:pre"></span><releases><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></releases><span style="white-space:pre"></span><snapshots><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></snapshots><span style="white-space:pre"></span></repository><span style="white-space:pre"></span><repository><span style="white-space:pre"></span><id>central</id><span style="white-space:pre"></span><url>http://repo.maven.apache.org/maven2</url><span style="white-space:pre"></span><releases><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></releases><span style="white-space:pre"></span><snapshots><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></snapshots><span style="white-space:pre"></span></repository><span style="white-space:pre"></span></repositories><span style="white-space:pre"></span><pluginRepositories><span style="white-space:pre"></span><pluginRepository><span style="white-space:pre"></span><id>local_nexus</id><span style="white-space:pre"></span><name>local_nexus</name><span style="white-space:pre"></span><url>http://localhost:8081/nexus/content/groups/public/</url><span style="white-space:pre"></span><releases><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></releases><span style="white-space:pre"></span><snapshots><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></snapshots><span style="white-space:pre"></span></pluginRepository><span style="white-space:pre"></span><pluginRepository><span style="white-space:pre"></span><id>central</id><span style="white-space:pre"></span><url>http://repo.maven.apache.org/maven2</url><span style="white-space:pre"></span><releases><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></releases><span style="white-space:pre"></span><snapshots><span style="white-space:pre"></span><enabled>true</enabled><span style="white-space:pre"></span></snapshots><span style="white-space:pre"></span></pluginRepository><span style="white-space:pre"></span></pluginRepositories></profile>
<activeProfiles><activeProfile>local_nexus</activeProfile></activeProfiles>
同样可以实现1.2中功能,只是1.2中是针对某一个maven工程,而setting 文件所有的maven项目都适用
0 0
- maven 配置nexus私服
- 配置maven私服nexus
- maven私服nexus配置
- nexus配置maven私服
- 配置maven私服nexus
- Maven 私服 Nexus 界面配置
- Maven私服Nexus配置教程
- 安装配置maven私服--nexus
- maven+nexus+Linux配置Maven私服
- maven 下载nexus私服jar配置
- Maven私服--Nexus的本地xml配置
- 用nexus搭建maven私服 配置
- maven私服nexus的安装、配置、使用
- 搭建Maven私服,并配置Nexus环境
- centos 下 nexus 私服 以及maven配置
- maven私服nexus的配置说明
- CentOS6.5 安装Nexus配置Maven私服
- maven搭建nexus私服settings.xml配置
- ldap服务器搭建——sudo权限配置
- Java语言基础
- Fragment
- AndroidStudio集成极光推送
- 对 jQuery 中 data 方法的误解分析
- maven 配置nexus私服
- 2015年总结和2016年计划
- java写一个爬虫
- Jigsaw项目会解决Java的JAR地狱问题么?
- html语言的<ul> <dir> <menu>标签有什么区别?
- 12306真的公平了吗?----一 转载
- CentOS PHP 开发,启用自动报错
- android studio 使用os文件。
- MATLAB绘图基础01—复杂网络工具箱命令