Maven私服-Nexus搭建文档
来源:互联网 发布:淘宝互刷平台源码 编辑:程序博客网 时间:2024/06/05 08:02
安装前提:
1、 安装jdk(忽略)
2、 安装Maven
· 1)载Maven并解压,官网下载对应系统的按安装包,http://maven.apache.org/download.cgi
· 2)、解压下载Maven安装包,并把解压后的文件夹下的apache-maven文件夹移动到系统目录下,例如D:\Java下。
3)右键“计算机”,选择“属性”,之后点击“高级系统设置”,点击”“环境变量”,来设置环境变量,有以下系统变量需要配置:新建系统变量 MAVEN_HOME 变量值:D:\Java\apache-maven-3.1.1
编辑系统变量 Path 添加变量值: ;%MAVEN_HOME%\bin
4)、检验是否安装成功:在命令行提示符窗口, mvn --version 若出现以下情况说明配置成功
·
搭建私服
1、下载nexus,官方下载地址:http://www.sonatype.org/nexus/go
可选择tgz和zip格式,以及war,选择tgz或zip时不同版本可能在启动时存在一定问题,可能是因为jdk版本问题,若无法启动请选择2.5或更早的版本
注:nexus 2.6版本之后不再支持jdk1.6
若下载war,则将其放置tomcat下的webapp目录中,改名为nexus,运行tomcat服务,即可访问http://localhost:8081/nexus 默认用户名:admin;密码admin123
若下载tag或者zip将其解压并拷贝到系统相关目录下,找到安装目录下的bin执行相关系统的启动命令,例如:Linux上执行nexus start,在window上执行nexus.bat启动服务,就可以访问http://localhost:8081/nexus 了。
配置使用:
在项目pom.xml中声明使用私服方式:
<repositories>
<repository>
<id>nexus-repository</id>
<name>TeamNexus Repository</name>
<url>http://10.110.13.14:8081/nexus/content/groups/inspur-jszx/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-plugin</id>
<name>TeamNexus pluginRepository</name>
<url>http://10.110.13.14:8081/nexus/content/groups/inspur-jszx/</url>
</pluginRepository>
</pluginRepositories>
在Maven配置文件中配置setting.xml中配置使用私服方式:
<profiles>
……………
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>central</id>
<url>http://10.110.13.14:8081/nexus/content/groups/inspur-jszx/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://10.110.13.14:8081/nexus/content/groups/inspur-jszx/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
……………
<profiles>
部署构件至远程仓库
mvn deploy 用来将项目生成的构件分发到远程Maven仓库。本地Maven仓库的构件只能供当前用户使用,在分发到远程Maven仓库之后,所有能访问该仓库的用户都能使用你的构件。
在pom中配置如下:
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Releases Repository</name>
<url>http://IP:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshots Repository</name>
<url>http://IP:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
在Settring.xml中加入验证配置信息:
<server>
<id>nexus-releases</id>
<username>neoyin</username>
<password>*****</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>neoyin</username>
<password>*****</password>
</server>
PS:
settings.xml中server元素下id的值必须与POM中repository或snapshotRepository下id的值完全一致
- Maven私服-Nexus搭建文档
- Maven私服-Nexus搭建文档
- Maven私服-Nexus搭建文档
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- nexus 搭建maven私服
- Maven私服nexus搭建
- 搭建Maven私服 - Nexus
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- Maven 私服nexus搭建
- Nexus搭建Maven私服
- Nexus 搭建Maven 私服
- nexus 搭建 maven 私服
- Nexus搭建Maven私服
- nexus搭建maven私服
- maven搭建nexus私服
- CentOS服务器配置之uwsgi的安装和使用(翻译文档)
- Java反射知识点总结
- CMVS-PMVS 知识库链接
- 负数在计算机中如何表示,计算机中负数为什么用补码表示?
- LintCode题目解答之字符串操作(2)
- Maven私服-Nexus搭建文档
- CentOS服务器配置之python环境配置
- java类型转换方法
- FORM的基础开发
- POJ 1703 带权并查集
- hdu2665 Kth number(主席树模板)
- MySQL主从同步实践
- iOS:json格式字符串转字典,字典转json格式字符串
- Spring Boot中使用JdbcTemplate访问数据库