Docker built using maven PW and routine use

Installation - Log - Configuration

下载镜像
docker pull sonatype/nexus3
运行
docker run -d -p 9998:8081 --name nexus --restart=always sonatype/nexus3

log in

Password into the container to see how much

docker exec -it 容器名/容器id /bin/bash

Follow the prompts on the map into the specified directory, view the password is valid

random code

Continue to access, change passwords

change Password

Modify PW central warehouse location, if they think that foreign site is too slow, we will be modified to Ali cloud, modify the way it is to replace what links it ok

Central warehouse

Create a hosted type of warehouse

Creating step1

Select Create a warehouse type is hosted type, why do you have to choose this type it? Decrypting the table below

project Specific instructions
hosted Local storage. The same as the official repository provides local private library function
proxy Acting provide other types of warehouse
group Group type can be combined to provide multiple services to a warehouse address

Continue to create

Creating step2

Create a PW account, then my windows this added to it in the local maven user information PW newly created, in turn, can use this to PW users to publish in jar package

Creating a User 1

Fill in the information users

Create a user 2

Settings.xml find the machine configuration file, add the PW we just created into

Published step1

ok, next to the idea of ​​publishing the jar package

release

The first is to connect the user information PW configuration into the configuration file

  1. id is the id of the image above
  2. url: find the nexus visual interface, we can find the url in the warehouse created above

Published step3

Preparation Script

 <!--添加build依赖,表示可以发布jar-->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8</version>
            </plugin>
            <!--发布源码的插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Issued an order:

mvn deploy

Stepped pit

  • Re-checked before publication about the idea configured on maven using settings.xml we just modify the configuration file, otherwise this is a pit, will always deploy fail
  • The above version got to the warehouse and the type of correspondence we created together, otherwise it will error fail

After publishing the results we continue to see the results, you can

View Results

Detailed results

View Results

Pull use

Use 1

Add the following dependencies in the pom file to ok

<dependency>
  <groupId>com.changwu</groupId>
  <artifactId>lawyer-eureka</artifactId>
  <version>1.0-RELEASE</version>
</dependency>
 <repository>
     <id>changwu</id>
     <name>lawyer-lover-release</name>
     <url>http://139.x.xx.235:9998/repository/lawyer-lover-release/</url>
</repository>

Welcome attention to my blog, I will put finishing docker (from entry to the deployment of micro-services) a full set of notes to share out

Guess you like

Origin www.cnblogs.com/ZhuChangwu/p/11945832.html