Nexus 使用攻略

一、私服地址及登陆账号密码

http://nexus.gongsi.com/

账号:zhanghao

密码:mima

 

二、需要上传jar包到私服时配置

1、本地maven配置默认在  settings.xml  <severs> 标签中添加如下配置

    <server>
      <id>gs-maven</id>
      <username>zhanghao</username>
      <password>mima</password>
    </server>

或者把下面的文件下载放到用户目录下的/.m2/下面,多种方式自选一种

 

2、在你需要上传的Jar包到Nexus的项目最外层pom加

<distributionManagement>
    <repository>
        <id>gs-maven</id>
        <url>http://nexus.gongsi.com/repository/maven-xxx/</url>
    </repository>
</distributionManagement>

3、你不想上传的子模块的pom中 ,添加到<project><build><plugins> 标签下添加如下配置 即可忽略该子模块deploy

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

 

三、想使用你上传到Nexus上的Jar包时,在你想使用的项目最外层pom.xml中添加,

<repositories>
<repository>
<id>gs</id>
<name>gongsi</name>
<url>http://nexus.gongsi.com/repository/maven-xxx/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>alibaba</id>
<url>https://maven.aliyun.com/repository/central/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑包括了aliyun的仓库,根据个人喜好增加或删除配置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值