Detailed steps for setting up a nexus server

Detailed steps for setting up a nexus server

1. The significance of building nexus service

As a unified proxy for the intranet, when developing collaboratively in a team, everyone does not need to download from the external network once;

Solve the problem that some abnormal companies cannot access the external network due to internal network control. Choose a machine with external network permissions to build the server, and the rest of the people can directly access this service through the internal network;

Solve Maven project dependency issues during teamwork development;

2. Install Nexus

# Download the installation package:
wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.14.4-03-bundle.tar.gz

# Unzip mkdir /data/apps
cd /data/apps
tar -zxvf ~/nexus-2.14.4-03-bundle.tar.gz

3. Configure Nexus

Edit the configuration file: vim conf/nexus.properties

# Jetty section
application-port=8081 # Access port application-host=0.0.0.0 # Bind IP
nexus-webapp=${bundleBasedir}/nexus # Specify the nexus program directory nexus-webapp-context-path=/nexus # Specify two sets of directories to access # Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF

The above are all default configurations, and the corresponding access address is: http://xxxx:8081/nexus

If you want to change to http://xxxx:8081, just modify nexus-webapp-context-path=/

4. Start Nexus

Startup script: bin/nexus

# The startup script has the following optional parameters [root@ci-gitlab nexus-2.14.4-03]# bin/nexus
Usage: ./nexus { console | start | stop | restart | status | dump }

Note: Nexus uses wrapper as a WEB container. Nexus is just a shell script, which will eventually call the wrapper binary file in the corresponding platform under the jsw directory.

5. Manage Nexus

1. Default user:

admin/admin123 
deployment/deployment123

2. Modify user information

After logging in as admin, click [Security-Users] on the left, select a user in the list, right-click to change the password and re-password, and modify the rest of the user information in the table at the bottom

6. Using Nexus in your project

1. As a plugin library

Click [Views/Repositories-Repositories] on the left, select [Public Repositories], copy its Repository Path field, edit the pom.xml file, and add the following section:

<!-- Set the main warehouse and search in the set order. -->
<!-- Set the main warehouse and search in the set order. -->
  <repositories>
    <repository>
      <id>releases</id>
      <name>Team Nexus Repository</name>
      <url>${Repository Path}</url>
    </repository>

    <repository>
      <id>snapshots</id>
      <name>Team Nexus Repository</name>
      <url>${Repository Path}</url>
    </repository>
  </repositories>

2. As a deploy library

Click [Views/Repositories-Repositories] on the left, select [Release or Snapshots], copy its Repository Path field, edit the pom.xml file, and add the following section:

<!-- Set the publishing location, used when mvn deploy, an error will be reported if not set-->
  <distributionManagement>
    <repository>
      <id>ci-releases</id>
      <name>Gigold Nexus Repository</name>
      <url>http://ci-gitlab:8081/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>ci-snapshots</id>
      <name>Gigold Nexus Repository</name>
      <url>http://ci-gitlab:8081/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

Note: If the distributionManagement section is not set, executing mvn deploy will report the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project helloworld-a: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of common command configuration of idea maven nexus
  • How to publish Maven project (jar package) to Nexus private server
  • Maven detailed tutorial on how to package and upload the project to nexus private server
  • Detailed explanation of sample code for springboot~nexus project packaging
  • How to use Nexus to build a Maven private server
  • Nexus uses API to operate
  • Getting started with Maven: Using Nexus to build a Maven private server and upload and download jar packages
  • How to use nexus to build a Maven private server and idea in a local area network
  • Nexus installation and configuration graphic tutorial

<<:  How to use bar charts in Vue and modify the configuration yourself

>>:  Install Apache2.4+PHP7.0+MySQL5.7.16 on macOS Sierra

Recommend

Linux beginners in virtual machines configure IP and restart the network

For those who are new to virtual machines or have...

Using css-loader to implement css module in vue-cli

【Foreword】 Both Vue and React's CSS modular s...

How to use the debouce anti-shake function in Vue

Table of contents 1. Anti-shake function 2. Use d...

How to enable JMX monitoring through Tomcat

Build a simulation environment: Operating system:...

MySQL max_allowed_packet setting

max_allowed_packet is a parameter in MySQL that i...

How to successfully retrieve VMware Esxi root password after forgetting it

Prepare a CentOS6 installation disk (any version)...

Detailed explanation of Linux zabbix agent deployment and configuration methods

1. Install zabbix-agent on web01 Deploy zabbix wa...

vue2.x configuration from vue.config.js to project optimization

Table of contents Preface vue.config.js configura...

Use PHP's mail() function to send emails

Sending emails using PHP's mail function The ...

Details of function nesting and closures in js

Table of contents 1. Scope 2. Function return val...

A brief introduction to MySQL dialect

Putting aside databases, what is dialect in life?...

Implementation steps for building FastDFS file server in Linux

Table of contents 1. Software Package 2. Install ...

centos 7 modify sshd | prohibit root login and sshd port script definition

1. Create a new user wwweee000 [root@localhost ~]...