Conventions:
System: CentOS
File Installation Location:/usr/local/nexus
: http://www.sonatype.org/nexus/go/
Official Document: Https://books.sonatype.com/nexus-book/reference/index.html
Nexus oss, say my understanding of the software, as far as I know, the Java project needs to use MAVEN build process, and in the Maven build need to use a variety of dependencies, the dependency package needs to download from the MAVEN online warehouse, the official warehouse address http:// repository.apache.org/snapshots/
http://repo1.maven.org/maven2/
http://nexus.codehaus.org/snapshots/
Sometimes it may be impossible to download a dependency package from an online repository for a variety of reasons (such as a lack of access to a public network), and then you need to download the dependency package ahead of time and upload it to the project, instead of deploying a MAVEN online repository and putting all the collected dependencies into this repository and then calling the project again. If you have the ability to develop a dependency package, you can also upload a dependency package to a warehouse for use by a third party.
The Nexus OSS is the open source software that builds this kind of warehouse, in fact Apache uses is also the Nexus deployment warehouse. After downloading the installation package, follow the official documentation to install it.
$sudo cp nexus-2.11.4-01-bundle.tar.gz/usr/local$cd/usr/local$ sudo tar xvzf nexus-2.11.4-01-bundle.tar.gz$ sudo ln-s n EXUS-2.11.4-01 Nexus
Configure Nexus Services
$sudo CP Nexus/bin/nexus/etc/init.d/nexus
Edit/etc/init.d/nexus Configuration
Nexus_home= "/usr/local/nexus" #nexus主目录RUN_AS_USER =web #运行nexus的用户, cannot use root User piddir= "/var/run/nexus.pid" #pid文件位置
After this configuration, you can start and close the Nexus using the service, join the self-boot
Chkconfig--add nexuschkconfig--level 345 Nexus on
The service can be accessed through a Web page,
Default Address Porthttp://localhost:8081/nexus/,默认帐号admin admin123
Apache Proxy
Proxyrequests offproxypreservehost on<virtualhost *:80> ServerName www.example.com ServerAdmin [email protected] Proxypass/nexus http://localhost:8081/nexus Proxypassreverse/nexus http://localhost:8081/nexus errorlog logs/ Www.example.com/nexus/error.log Customlog Logs/www.example.com/nexus/access.log common</virtualhost>
Nginx Proxy
Http { proxy_send_timeout 120; proxy_read_timeout 300; proxy_buffering off; keepalive _timeout 5 5; tcp_nodelay on; server { listen *:80; server_name www.example.com; # allow large uploads of files - Refer to nginx documentation client_max_body_ size 1g # optimize downloading files larger than 1g - refer to nginx doc before adjusting #proxy_max_temp_file_size 2g location /nexus { proxy_pass http:// Localhost:8081/nexus; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for; } }}
Nginx SSL
Http { proxy_send_timeout 120; proxy_read_timeout 300; proxy_buffering off; keepalive _timeout 5 5; tcp_nodelay on; server { listen *:443; server_name repo.example.com; # allow large uploads of files - refer to nginx documentation client_max_ Body_size 1g # optimize downloading files larger than 1G - refer to nginx doc before adjusting #proxy_max_temp_file_size 2G ssl on ssl_certificate example.pem; ssl_certificate_key example.key; location / { proxy_pass http://localhost:8081/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote _addr; proxy_set_header X-Forwarded-For $proxy _add_x_forwarded_for; proxy_set_header x-forwarded-proto "https"; } }}
For the configuration of the page and the addition of the Library, refer to the official document Https://books.sonatype.com/nexus-book/reference/config-sect-new-repo.html
You can leave a message for me.
This article is from the "Morrowind" blog, make sure to keep this source http://morrowind.blog.51cto.com/1181631/1713697
Nexus Deployment Maven Repository