maven nexus私服搭建

 

1. 下载

wget http://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz

2. 解压 

tar zxvf nexus-2.12.0-01-bundle.tar.gz

解压后两个目录

nexus-2.12.0-01  //应用路径

sonatype-work   //开发包存放路径

3. 配置

vim bin/nexus

RUN_AS_USER=root

vim conf/nexus.properties 
application-port=8888   //启动端口
nexus-work=/xxx/data/sonatype-work/nexus  //jar包存放路径

  

4. 启动

./bin/nexus start

 

5. 查看UI

http://xxx.201.69.8:8888/nexus/

  login default: admin/admin123

6. 配置nexus

  将type为proxy的Repository的Download Remote Indexes  设置为true.

  本地hosted仓库取不到即会向proxy远程仓库取。 

7. IDE project配置

// pom.xml
<distributionManagement>
    <repository>
      <id>releases</id>
      <name>xxx Releases</name>
      <url>http://xxx.201.69.8:8888/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <name>xxx Snapshots</name>
      <url>http://xxx.201.69.8:8888/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>

// setting.xml
    <server>
        <id>releases</id>
        <username>lqy_dev</username>
        <password>lqy123</password>
    </server>
    <server>
        <id>snapshots</id>
        <username>lqy_dev</username>
        <password>lqy123</password>
    </server>

  

 发布不能成功可能原因,setting文件配置不正确,查看实际使用的setting文件:

mvn help:effective-settings

  

转载于:https://www.cnblogs.com/kisf/p/7722511.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值