linux安装配置nexus

首先安装好jdk,未安装执行

yum -y install java-1.8.0-openjdk*

下载nexus-2.14.3-02-bundle.tar.gz文件,自己去找

解压tar xfvz nexus-2.14.3-02-bundle.tar.gz

 打开 /etc/profile文件在最后添加export RUN_AS_USER=root

vi /etc/profile

修改后执行

source /etc/profile

进入解压过的nexus-2.14.3-02文件夹执行

./bin/nexus start

通过端口访问浏览器,登录默认账号密码  admin/admin123

如果需要使用私服,可在工程pom文件里添加如下配置,id和name貌似是随便取的,不知道具体用途,当然也可以在maven的server.xml里配置,我没有成功,有报错

<repositories>
    <repository>
        <id>nexus-repository</id>
        <name>myNexus</name>
        <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
    </repository>
</repositories>

需要上传本地工程到jar包里,可以如下配置

<distributionManagement>
    <repository>
        <id>release-repository</id>
        <name>release-repository</name>
        <url>http://ip:8081/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
        <id>snapshot-repository</id>
        <name>snapshot-repository</name>
        <url>http://ip:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

同时在maven的server.xml的<servers>里配置需要添加账号,注意id需要保障一致,账号密码默认deployment/deployment123,

<servers>
 
    <server>
      <id>snapshot-repository</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
    <server>
      <id>release-repository</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
    
  </servers>

可去网页上修改上传的账号密码,Security->Users->deployment,在下方config里修改,登入账号admin也可这样修改

点击deploy

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值