Configure the profile in settings to realize the central warehouse for private server and external network for local area network

 

Generally, private servers are built on the local area network, which means that private servers cannot be used on the external network;

 If the configuration uses mirrors to map to the private server, then the private server cannot be connected to the external network, which is a sad reminder;

Later, it was found that the private server address can be configured through the profile. When it is on the local area network, the private server address is preferentially used. When it is on the external network (when the private server cannot be connected ), it will switch to the default external network warehouse central warehouse ( repo.maven.apache.org ).

 

 Modify settings.xml configuration:

 

 

1. Add under the profiles node:

 

        <profile>

            <id>public-snapshots</id>

            <repositories>

                <repository>

                    <id>public-snapshots</id>

                    <url>http://10.122.7.92:8081/nexus/content/groups/public/</url>

                    <snapshots>

                        <enabled>true</enabled>

                    </snapshots>

                </repository>

            </repositories>

        </profile>

 

 

2. Configure and activate the above profile under the activeProfiles node

 

<activeProfiles>

    <activeProfile>public-snapshots</activeProfile>

  </activeProfiles>

 

 

 

 

 

 

2018/2/10 GMT+8 下午9:26:56: [INFO] Downloaded http://10.122.7.92:8081/nexus/content/groups/public/com/bbossgroups/bboss-velocity/5.0.3.8.3/bboss-velocity-5.0.3.8.3.jar 2018/2/10 GMT+8 下午9:27:06: [INFO] Downloaded http://10.122.7.92:8081/nexus/content/groups/public/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar 2018/2/10 GMT+8 下午9:27:16: [INFO] Downloaded http://10.122.7.92:8081/nexus/content/groups/public/werken-xpath/werken-xpath/0.9.4/werken-xpath-0.9.4.jar 2018/2/10 GMT+8 下午9:27:18: [INFO] Downloading https://repo.maven.apache.org/maven2/com/bbossgroups/bboss-velocity/5.0.3.8.3/bboss-velocity-5.0.3.8.3.jar 2018/2/10 GMT+8 下午9:27:36: [INFO] Downloaded https://repo.maven.apache.org/maven2/com/bbossgroups/bboss-velocity/5.0.3.8.3/bboss-velocity-5.0.3.8.3.jar 2018/2/10 GMT+8 下午9:27:36: [INFO] Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar 2018/2/10 GMT+8 下午9:27:39: [INFO] Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar 2018/2/10 GMT+8 下午9:27:41: [INFO] Downloading https://repo.maven.apache.org/maven2/werken-xpath/werken-xpath/0.9.4/werken-xpath-0.9.4.jar 2018/2/10 GMT+8 下午9:27:52: [INFO] Downloaded https://repo.maven.apache.org/maven2/werken-xpath/werken-xpath/0.9.4/werken-xpath-0.9.4.jar

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326271217&siteId=291194637
Recommended