The Nexus has built himself a Maven PW

Maven public service http://maven.aliyun.com

  1. https://hub.docker.com search nexus

  2. docker pull sonatype/nexus3

  3. Docker create directory, create nexus directory

    cd /usr/local/
    mkdir docker
    cd docker/
    mkdir nexus
    cd nexus/
    vi docker-compose.yml

  4. Docker to install and run using the Nexus, docker-compose.yml configured as follows:

    version:'3.1'
    services:
    nexus:
    restart:always
    image:sonatype/nexus3
    container_name:nexus
    ports:
    -8081:8081
    volumes:
    - /usr/local/docker/nexus/data:/nexus-data

  5. docker-compose up -d

  6. Visit http: // ip: 8081

  7. View Log
    Docker PS
    Docker logs containerID

  8. If the error no authority to see if there is data in the data, so that data have all privileges
    cd / data /

    ll

    docker-compose down

    chmod 777 data/

  9. docker-compose -up -d

  10. Start nexus memory consumption, see memory state, startup takes nearly nexus 1G memory;

    free -h

    htop

  11. Landing nexus, the default user name adminpasswordadmin123

  12. Add Nexus Maven setting.xml the authentication information (the node servers)


    nexus-releases
    admin
    admin123


    nexus-snapshots
    admin
    admin123

  13. Associate project and PW up, add configuration in pom.xml


    nexus-releases
    Nexus Release Repository
    http://192.168.0.148:8081/repository/maven-releases/



    nexus-snapshots
    Nexus Snapshot Repository
    http://192.168.0.148:8081/repository/maven-snapshots/


Note: ID and setting.xml Servers configured in the same
url address matches the address of the warehouse, PW

  1. mvn deploy -Dmaven.test.skip=true

  2. Need to rely on local projects to go find, did not go to the local PW (intranet) to find, PW did not go to the official uniform look;
    third-party dependent or write their own jar, can be uploaded to PW manual, version 3.13 supports uploading nexus

  3. Configuring warehouse agent is intended to enable the project to go to a local warehouse rely PW download


    nexus
    Nexus Repository
    http://192.168.0.148:8081/repository/maven-public/

    true


    true





    nexus
    Nexus Repository
    http://192.168.0.148:8081/repository/maven-public/

    true


    true


  4. Here you can project from PW to a local warehouse

1, SNAPSHOT version represents the unstable (snapshot version), is still in the development stage, there will be change at any time. When uploading the same version number when the jar package, SNAPSHOT will automatically append the new digital version of the bunch in the back, that is, log label;

2, RELEASE represents the stable version (release version), generally on the line will switch to RELEASE version.

In maven dependency management system that uniquely identifies a dependency is a dependency of the properties of the three configuration, respectively groupId, artifactId and Version. These three properties uniquely identify a component (that is, we usually say the war package and jar package).

  1. Public warehouse is a collection of snapshots and release versions of maps

Guess you like

Origin www.cnblogs.com/cgy-home/p/11238128.html