CentOS7 install maven private server warehouse nexus3 tutorial



download

installation

1. Download to the specified directory, and then run the command to decompress:

tar -zxvf nexus-3.23.0-03-unix.tar.gz -C /opt/

There will be 2 folders under /opt, one is the directory of nexus software, and the other is its running data directory

Modify the parameters (important, the system with low configuration cannot start without modifying this parameter)

To customize the configuration virtual machine, you can open the nexus.vmoptions file for configuration, enter the nexus-3.23.0-03 directory and execute the command:
vim bin/nexus.vmoptions //虚拟机选项配置文件

Modify the first few parameters of jvm and lower the startup parameters:

start up

Start Nexus (the default port is 8081). Some commonly used commands for Nexus include: /usr/local/nexus/nexus/bin/nexus {start|stop|run|run-redirect|status|restart|force-reload}, below we Start Nexus:

  • Start command (start in background):./bin/nexus start
  • Stop command: ./bin/nexus stop

The above warning does not affect startup and can be ignored.

To verify whether the startup is successful, enter the command: ps -ef | grep nexus

seeing this indicates that the startup has been successful.

warehouse

When visiting: http://ip:8081/, there will be a nexus interface:

Default account: admin, the default password is in the /opt/sonatype-work/nexus3/admin.password file.
Open this file to get the password to log in. You need to change the password after logging in.

After logging in, click the configuration button:

select the maven public group for configuration:

We directly click on maven-central to configure and replace the warehouse pulled by default with Alibaba Cloud:
http://maven.aliyun.com/nexus/content/groups/public/

Go to the bottom of the page and click save to save the configuration.

At this point, the warehouse configuration is complete.

插入版权声明
本文地址:https://blog.csdn.net/xqnode/article/details/107440806
作者:xqnode
转载请附上作者和原文链接,谢谢!

use

Open the maven configuration file settings.xml, click the copy button of maven-public to get the address of the warehouse from the private server, http://47.xx.xx.xx:8081/repository/maven-public/

Modify the servers and mirrors nodes in the configuration, the mirror URL fills in the warehouse address obtained above, and the username and password fill in the account created in the warehouse.

Note: The id of the first node of severes must be the same as the id of the first node of mirrors.

</servers>
  <server>
      <id>nxmaven</id>
      <username>xqnode</username>
      <password>123456</password>
    </server>
	<server>
       <id>snapshots</id>
       <username>xqnode</username>
       <password>123456</password>
     </server>
     <server>
       <id>releases</id>
       <username>xqnode</username>
       <password>123456</password>
     </server>
  </servers>

 <mirrors>
	<mirror>
      <id>nxmaven</id>
      <name>nx maven</name>
      <url>http://xx.xx.xx.xx:8081/repository/maven-public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>

Use in idea:


It’s not easy to create, your likes and attention are my greatest support ٩(๑❛ᴗ❛๑)۶
↓↓↓

Guess you like

Origin blog.csdn.net/xqnode/article/details/107440806