CentOS7 install nexus

Note: Please install JDK 1.7 or above in advance

1: Nexus official website download address: http://www.sonatype.org/nexus/go/

2: Upload the compressed package to the usr/local/nexus directory

3: Unzip

After decompression, look at the decompression directory to see a nexus service, a private library directory

4: Edit the nexus.properties file of nexus, configure the port and work directory information (keep the default)

vim nexus.properties

5: Edit the nexus script, configure the RUN_AS_USER parameter

Change NEXUS_HOME=".." to NEXUS_HOME="nexus installation directory" (you can also change the default without modifying it)

#RUN_AS_USER= 改为:RUN_AS_USER=root

 

6: Open port 8081 in the firewall [etc directory usually puts some scattered configuration files]
[root @localhost  conf]# vi /etc/sysconfig/iptables
Add:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server
After saving, restart the firewall (even if the firewall is open, you can access it, as the server security first)
[root @localhost  conf]# service iptables restart

Note: If the firewall has been permanently closed, you can ignore Step 6
: 7: Start nexus

Browser input address http://server IP:8081/nexus displays the following page

Click Log In to log in, the default username is admin, the default password is admin123

At this point, Nexus has been installed.

Nexus' Access Rights Model

Nexus performs access control based on permissions. Each resource of the server has corresponding permissions to control, so users must have the necessary permissions to perform specific operations. Admins must grant permissions to Nexus users as roles. Users can be assigned one or more roles, roles can contain one or more permissions, and roles can also contain one or more other roles.

Three users are predefined on Nexus. After logging in with admin, click the User link on the left side of the page to see the following list:

1.admin:

This user has full privileges on Nexus, and the default password is admin123.
2.deployment:

This user can access Nexus, browse repository contents, search, and upload deployment artifacts, but cannot perform any configuration on Nexus. The default password is deployment123.
3. Anonymous:

This user corresponds to all anonymous users who are not logged in, who can browse the repository and search.

Add new user and grant login access

Adding third-party jars By default, Nexus creates the following main Repository for us :
1. Public Repositories

This is a Repository Group that contains multiple Repositories, including Releases, Snapshots, ThirdParty and Central.
2. 3rd party

The Repository is where the third-party software repositories purchased by your company are stored. It is a Repository maintained by Nexus itself. 
3. Apache Snapshots

This is a proxy Repository, that is, the final dependencies still have to be downloaded from the Apache official website, and then cached in Nexus.
4. Central

This is the Repository that proxies the Maven Central Repository.
5. Releases

When your own project is to be published, it should be published in this Repository, which is also the Repository maintained by Nexus itself, not a proxy.
6. Snapshots

Repository for snapshot versions of your own projects.

Use 3rd party to upload third-party jar package

In the Repository list, select 3rd party, select artifact upload,

Select GAV Defini3ion: GAV Parameters and check Auto Guess.

Enter the Group, Artifact, and Version corresponding to the JAR package below, and select the JAR format for Packaging.

Click the select Artifact(s) to upload button to select the JAR package to upload.

As shown below

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server

 Then

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server

OK Upload successful!

Enter pinyin4j and click search

As shown below:

CentOS installs Nexus (Maven private library) detailed configuration and uploads local jar to private server

Guess you like

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