Nexus 3.x Linux环境搭建(手把手) 排坑之旅

Nexus 3.x 界面升华 :Linux 系统下排坑之旅:

* Nexus 3.12.1-01 OSS为例*

**

- 环境搭建:

**

    1   下载地址:https://www.sonatype.com/download-oss-sonatype 
    2   WinSCP 上传文件此文件,解压:
    3   tar -xzvf  nexus-3.12.1-01-unix.tar.gz 解压
    4   配置PATH具有java的成员变量
  • 运行nexus

    1. cd nexus目录/bin
    2. ./nexus start 出现:then set the environment variable RUN_AS_USER=root
    3. vi nexus.rc run_as_user=root 配置启动用户 尽量不要是root 要不会提示 Detected execution as “root” user. This is NOT recommended!
  • 每次这么运行有些麻烦 想让系统重启的时候自动运行,构建成服务:
    1. sudo ln -s {nexus地址}/bin/nexus /etc/init.d/nexus
    2. 注意此次构建运行会出现:
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8 and at most 1.8.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

Nexus 3.x Linux环境搭建(手把手) 排坑之旅_第1张图片
加上这句话:然后重新输入:
如果先头已经运行了下面的命令:需要先去/etc/init.d/删除掉nexus服务

  1. sudo ln -s {nexus地址}/bin/nexus /etc/init.d/nexus 构建服务成功。
  2. service nexus status
  3. service nexus start
  4. service nexus stop

    系统自动重启:
    systenctk enable nexus.service 加入开机启动


之后进行配置nexus 默认端口8081 nexus下etc 可以改配置文件

打开: ipv4:8081 nexus 地址
右上角登录,admin admin123

Nexus 3.x Linux环境搭建(手把手) 排坑之旅_第2张图片

创建如下三个库:
Nexus 3.x Linux环境搭建(手把手) 排坑之旅_第3张图片

注意hosted:
Nexus 3.x Linux环境搭建(手把手) 排坑之旅_第4张图片

然后经过配置 xml pom 文件就可以进行使用了

  <mirrors>
    <mirror>
      <id>mirrorIdid>
      <mirrorOf>repositoryIdmirrorOf>
      <name>Human Readable Name for this Mirror.name>
      <url>http://my.repository.com/repo/pathurl>
    mirror>
  mirrors>

profile>
    <id>nexusid>
    
    
    <repositories>
        <repository>
        <id>centralid>
        <url>http://xxxxx/repository/rainGroup/url>
        <releases><enabled>trueenabled>releases>
        <snapshots><enabled>trueenabled>snapshots>
        repository>
    repositories>
    <pluginRepositories>
        <pluginRepository>
        <id>centralid>
        <url>http://xxxxx/repository/rainGroup/url>
        <releases><enabled>trueenabled>releases>
        <snapshots><enabled>trueenabled>snapshots>
        pluginRepository>
    pluginRepositories>
    profile>
  profiles>
    <activeProfiles>
                  <activeProfile>nexusactiveProfile>
  activeProfiles>

pom.xml:

 <distributionManagement>
        <repository>
            <id>thirdpartyid>
            <name>Nexus Thirdparty Repositoryname>
            <url>http://xxxxx:8081/repository/rainGroup/url>
        repository>
        <snapshotRepository>
            <id>nexusid>
            <name>Nexus Snapshotname>
            <url>http://xxxxxxx:8081/repository/rainGroup/url>
        snapshotRepository>
    distributionManagement>
    <repositories>
        <repository>
            <id>nexusid>
            <url>http://xxxxxx/repository/rainGroup/url>
            <releases>
                <enabled>trueenabled>
            releases>
            <snapshots>
                <enabled>trueenabled>
            snapshots>
        repository>
    repositories>

你可能感兴趣的:(linux,nexus)