Linux下 nexus搭建maven私有库 自动打包
2017-02-03 16:17
489 查看
首先需要安装nexus:http://www.sonatype.org/nexus/go/
执行命令解压tar包
tar zxvf nexus-2.11.3-01-bundle.tar.gz
进入解压好的目录
cd nexus-2.11.3-01
进入bin目录运行nexus
cd bin
./nexus start
关闭nexus的命令是
./nexusstop
启动成功后打开浏览器键入URL(默认端口8081,可修改)
http://localhost:8081/nexus/index.html
点击这里登陆
默认账户:admin
默认密码:admin123
http://localhost:8081/nexus/index.html
点击这里登陆
默认账户:admin
默认密码:admin123
将所有type为proxy的configuration配置选项中DownloadRemoteIndex置为True,然后点击Save保存
其中3rd party选项中可以上传第三方jar包一些maven下载不下来的,公共仓库上找不到的,就可以在3rd party中的Artifacts upload选项卡中上传jar包
新建组
将右边的Available Repositories全部拖到左边点击Save保存
将Releases仓库的Deployment Policy设置为*Allow ReDeploy
pom.xml配置
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
设置deployment账户密码
setting.xml配置
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
最后右键项目->Run As->Run Configurations双击左边选项卡的Maven Build新建一个,如图所示
最后就可以在仓库中看到打好的包
需要注意的是,当pom.xml中同时配置了releases仓库和snapshots仓库时pom.xml文件开头的版本配置
执行命令解压tar包
tar zxvf nexus-2.11.3-01-bundle.tar.gz
进入解压好的目录
cd nexus-2.11.3-01
进入bin目录运行nexus
cd bin
./nexus start
关闭nexus的命令是
./nexusstop
启动成功后打开浏览器键入URL(默认端口8081,可修改)
http://localhost:8081/nexus/index.html
点击这里登陆
默认账户:admin
默认密码:admin123
http://localhost:8081/nexus/index.html
点击这里登陆
默认账户:admin
默认密码:admin123
将所有type为proxy的configuration配置选项中DownloadRemoteIndex置为True,然后点击Save保存
其中3rd party选项中可以上传第三方jar包一些maven下载不下来的,公共仓库上找不到的,就可以在3rd party中的Artifacts upload选项卡中上传jar包
新建组
将右边的Available Repositories全部拖到左边点击Save保存
将Releases仓库的Deployment Policy设置为*Allow ReDeploy
pom.xml配置
<!-- 私有仓库 --> <repositories> <repository> <id>public</id> <!--这个ID需要与你新建的组group ID一致--> <name>Public Repository</name> <url>http://xxx.xx.xx.xx:8081/nexus/content/groups/public/</url> </repository> </repositories> <!-- 自动打包 --> <distributionManagement> <repository> <id>releases</id><!--这个ID需要与你的release仓库的Repository ID一致--> <url>http://xxx.xx.xx.xx:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>snapshots</id><!--这个ID需要与你的snapshots仓库的Repository ID一致--> <url>http://xxx.xx.xx.xx:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
设置deployment账户密码
setting.xml配置
<server> <id>releases</id> <username>deployment</username> <password>admin123</password><!--这个密码就是你设置的密码--> </server> <server> <id>snapshots</id> <username>deployment</username> <password>admin123</password><!--这个密码就是你设置的密码--> </server>1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
最后右键项目->Run As->Run Configurations双击左边选项卡的Maven Build新建一个,如图所示
最后就可以在仓库中看到打好的包
需要注意的是,当pom.xml中同时配置了releases仓库和snapshots仓库时pom.xml文件开头的版本配置
<version>1.0.0-SNAPSHOT</version>为build到snapshots库,而
<version>1.0.0</version>**不带-SNAPSHOT的会build到releases库,如果只配置了releases库而版本号写的是带-SNAPSHOT的,build到最后一步会报400错误。
相关文章推荐
- linux下 nexus搭建maven私有库 自动打包
- linux下nexus搭建maven私有库自动打包
- linux下 nexus搭建maven私有库 自动打包
- Linux安装配置maven3.0以及搭建nexus私服
- maven自动打包上传nexus仓库配置
- Linux安装配置maven以及搭建nexus私服
- 08(maven+SSH)网上商城项目实战之使用nexus搭建maven私有服务器
- Linux环境下Maven仓库的搭建(nexus)及Mavan的简单使用
- maven私服:用nexus搭建企业级私有仓库
- Maven_linux下 maven安装及nexus私服搭建
- Linux安装配置maven以及搭建nexus私服
- 08(maven+SSH)之使用nexus搭建maven私有服务器
- 用nexus搭建自己的maven私有仓库
- Nexus搭建Maven私服(四) Maven 相关打包插件
- Linux下使用nexus搭建maven私服
- 用nexus搭建自己的maven私有仓库
- linux下 maven安装及nexus私服搭建
- Linux 安装配置maven3.0 以及搭建nexus私服
- Linux 安装配置maven3.0 以及搭建nexus私服
- 08(maven+SSH)网上商城项目实战之使用nexus搭建maven私有服务器