Nexus3的使用
来源:互联网 发布:知乎大学生推荐书单 编辑:程序博客网 时间:2024/06/05 02:47
这章主要讲怎么和Maven做集成,集成的方式主要分以下种情况:代理中央仓库、Snapshot包的管理、Release包的管理、第三方Jar上传到Nexus上
1 代理中央仓库
只要在PMO文件中配置私服的地址即可,配置如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
<repositories>
<repository>
<id>maven-central</id>
<name>maven-central</name>
<url>http:
//10.0.1.42:8081/repository/maven-central/</url>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
<releases>
<enabled>
true
</enabled>
</releases>
</repository>
</repositories>
2 Snapshot包的管理
1、 修改Maven的settings.xml文件,加入认证机制
1
2
3
4
5
6
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
2、 修改工程的Pom文件
1
2
3
4
5
6
7
8
9
10
11
12
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>Nexus Snapshot</name>
<url>http:
//10.0.1.42:8081/repository/maven-snapshots/</url>
</snapshotRepository>
<site>
<id>nexus</id>
<name>Nexus Sites</name>
<url>dav:http:
//10.0.1.42:8081/repository/maven-snapshots/</url>
</site>
</distributionManagement>
注意事项:
截图中的名字要跟apache-maven-3.0.5-nexus\conf\settings.xml的名字一定要对应上。
3、 上传到Nexus上
a)、项目编译成的jar是Snapshot(POM文件的头部)
1
2
3
4
<groupId>com.woasis</groupId>
<artifactId>test-nexus</artifactId>
<version>1.0.0-SHAPSHOT</version>
<packaging>jar</packaging>
b)、使用mvn deploy 即可,运行结果如图所示:
c、因为Snapshot是快照版本,默认他每次会把Jar加一个时间戳,做为历史备份版本。
3 Releases包的管理
a)、与Snapshot大同小异,只是上传到私服上的Jar包不会自动带时间戳,如图所示:
b)、与Snapshot配置不同的地方,就是工程的PMO文件,加入repository配置
1
2
3
4
5
6
<distributionManagement>
<repository>
<id>nexus</id>
<name>Nexus Snapshot</name>
<url>http:
//10.0.1.42:8081/repository/maven-releases/</url>
</repository>
c)、打包的时候需要把Snapshot去掉,如图所示:
1
2
3
4
<groupId>com.woasis</groupId>
<artifactId>test-nexus</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
4 第三方Jar上传到Nexus
1
mvn deploy:deploy-file -DgroupId=org.jasig.cas.client -DartifactId=cas-client-core -Dversion=3.1.3 -Dpackaging=jar -DrepositoryId=nexus -Dfile=D:\cas-client-core-3.1.3.jar -Durl=http:
//10.0.1.42:8081/repository/maven-releases/-DgeneratePom=false
注意事项:
-DrepositoryId=nexus 对应的就是Maven中settings.xml的认证配的名字。
阅读全文
0 0
- Nexus3的使用
- Nexus3的使用
- Nexus3.0.0+Maven的使用
- nexus3.4.0部署使用
- windows下使用nexus3进行内部maven仓库的管理
- 使用Nexus3搭建Maven私服
- 使用nexus3搭建私有仓库
- 使用Nexus3搭建Maven私服
- linux nexus3.0.1安装、使用
- nexus3的maven库安装
- maven私库nexus3安装及使用
- maven私库nexus3安装及使用
- Linux环境使用Nexus3搭建Maven私服
- maven私服nexus3搭建和使用
- nexus3.3.2配置使用(mac版)
- nexus3.XX的下载安装和配置
- 关于Nexus3配置maven遇到的问题
- Nexus3的功能介绍-简单版
- linux常用命令及用法
- 删除所有cookie或者清空所有cookie值
- JS点击图片放大预览
- 实际问题:水印平铺,以二维规则小图形对大图形进行填充问题解决
- Vuejs全家桶系列(二)--- Ajax请求
- Nexus3的使用
- 对基本数据类型及自动拆箱、自动装箱的理解
- 应用间共享sharedpreference
- 关于数据中心机房的专业名词
- ls-l
- Binder进程间通信机制(图文解析)
- String length must be a multiple of four.
- ArcGIS Server路径分析结果汉化
- pycharm远程调试配置