Maven 自动打包上传到私服 Nexus
来源:互联网 发布:国家卫生统计网络直报 编辑:程序博客网 时间:2024/05/29 14:30
配置
上传私服 pom.xml 配置
Maven获取jar的默认顺序是
1. Releases 在发布库里面查找(主要用于稳定版)
2. Snapshots 在快照库里面查找(和上面的区别就是在pom加了个<version>0.0.5-SNAPSHOT</version>,主要用于开发阶段)
3. 3rd party 不是我们自己开发的,也在中央库找不到的,就要到这里手动上传包到私服。
4. Central 到中央库查找。
1
2
3
4
5
6
7
8
9
10
<
distributionManagement
>
<
repository
>
<
id
>releases </
id
>
<
url
>http://vrouter.lz-oa.com:8081/nexus/content/repositories/releases/ </
url
>
</
repository
>
<
snapshotRepository
>
<
id
>Snapshots </
id
>
<
url
>http://vrouter.lz-oa.com:8081/nexus/content/repositories/snapshots</ url>
</
snapshotRepository
>
</
distributionManagement
>
settings.xml 配置
1
2
3
4
5
6
7
8
9
10
11
12
<
servers
>
<
server
>
<
id
>releases</
id
>
<
username
>admin</
username
>
<
password
>qsapwd</
password
>
</
server
>
<
server
>
<
id
>Snapshots</
id
>
<
username
>admin</
username
>
<
password
>qsapwd</
password
>
</
server
>
</
servers
>
打包源码 pom.xml 配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<
build
>
<
plugins
>
<
plugin
>
<!-- 打jar包 -->
<
groupId
>org.apache.maven.plugins</
groupId
>
<
artifactId
>maven-jar-plugin</
artifactId
>
<
version
>2.4</
version
>
<
configuration
>
<
excludes
>
<
exclude
>**/*.properties</
exclude
>
</
excludes
>
</
configuration
>
</
plugin
>
<
plugin
>
<!-- 打源码 -->
<
groupId
>org.apache.maven.plugins</
groupId
>
<
artifactId
>maven-source-plugin</
artifactId
>
<
version
>2.4</
version
>
<
configuration
>
<
attach
>true</
attach
>
</
configuration
>
<
executions
>
<
execution
>
<
phase
>compile</
phase
>
<
goals
>
<
goal
>jar</
goal
>
</
goals
>
</
execution
>
</
executions
>
</plugin>
</
plugins
>
</
build
>
Maven 打源码包,并上传私服
1. 使用命令行
cmd 进入到项目根目录执行:mvn clean source:jar package 会生成两个jar,其中有一个是源码的jar,分别使用相同的groupId和artifactId。
也可以直接,打包并上传私服,使用命令:deploy -e
2. 使用Eclipse
右击项目 Run as →Maven bulid,在Goals输入deploy -e。
0 0
- Maven 自动打包上传到私服 Nexus
- maven/gradle 打包后自动上传到nexus仓库
- maven/gradle 打包后自动上传到nexus仓库
- maven自动打包上传
- Maven打包自动发布到nexus私服
- maven/gradle 打包后自动上传到nexus仓库---学习笔记
- maven 打包上传到私服
- linux下 nexus搭建maven私有库 自动打包
- linux下nexus搭建maven私有库自动打包
- Linux下 nexus搭建maven私有库 自动打包
- linux下 nexus搭建maven私有库 自动打包
- eclipse 使用Maven deploy命令打包源码到私服nexus
- maven利用nc瑞士军刀自动上传打包文件
- maven学习-打包项目到nexus异常
- Intellij IDEA maven 打包到Nexus
- maven打包上传源码
- maven 上传jar到nexus私服
- maven第三方jar包上传nexus
- 使用httpclient-4.5.2以form表单形式上传文件 java
- 对理解rtmp协议有用的几篇文章
- java 的hashCode值计算
- GSS 1 区间最大子段和
- java的锁,synchronize和lock
- Maven 自动打包上传到私服 Nexus
- php实现四种排序算法
- 微信小程序-利用wxParse将html转为wxml
- JS正则表达式一条龙讲解,从原理和语法到JS正则、ES6正则扩展,最后再到正则实践思路
- ubuntu14.04 + sublime text3安裝
- Yoshua Bengio等大神传授:26条深度学习经验
- shell中大小写转换
- MySQL入门之一次函数调用执行多条语句
- MySQL入门之一次函数调用执行多条语句