Sonatype Nexus
lastmod 2025-12-08created 2018-08-1915 edits
Nexus is a Maven repository manager, a tool for setting up the internal repositories that a project or company needs.
Category
- SonatypeNexus:Apt - How to configure an apt Repository in Sonatype Nexus.
Blacklist IP address
Nexus uses the Jetty container and Jetty provides a handler that can be used to restrict access by IP addresses and subnets.
Attached is a sample jetty config file that allows you to configure the IP Access Handler using Nexus 2.8+.
To configure it:
- Download and store the file at
NEXUS_HOME/conf/jetty-ipaccess.xml, with the same permissions as the other jetty files - Edit
NEXUS_HOME/conf/jetty-ipaccess.xml, add white listed and blacklisted addresses using the syntax as documented in the javadoc. By default, all access is allowed - Edit
NEXUS_HOME/bin/jsw/conf/wrapper.conf, and reference the new jetty file as an app parameter iewrapper.app.parameter.3=./conf/jetty-ipaccess.xml( 3 by default, however the next available number must be used ) - restart Nexus
See Jetty#IPAccessHandler for the detailed configuration.
Blacklist of Nexus 3.x version
The configuration for Nexus 3.x is as follows.
- Create a
jetty-ipaccess.xmlfile in the/opt/sonatype/nexus/etc/jettypath, - then add
${jetty.etc}/jetty-ipaccess.xmlto thenexus-argsproperty in the/opt/sonatype/nexus/etc/nexus-default.propertiesfile. (Separate multiple arguments with,) - Then reboot Nexus.
Upload artifact
- How can I programmatically upload an artifact into Nexus 2?
- How to manually deploy artifacts in Nexus Repository Manager OSS 3
- Raw Repositories and Maven Sites
$ curl --fail -u admin:admin123 --upload-file foo.jar 'http://my-nexus-server.com:8081/repository/my-raw-repo/'
See also
Favorite site
Guide
- Setup nexus repository server
- An explanation of how to use Nexus, a useful open-source tool when using Maven
- Sonatype Nexus #2 : Configuration and connecting with maven
- Sonatype Nexus installation and configuration
- Cho Dae-hyup's blog :: maven nexus installation
- Sonatype Nexus installation and configuration
- Nexus installation and configuration
- How to install MAVEN, installing Nexus to create an in-house repository
- [Recommended] Nexus 3.X - Using it as a Maven and NPM repository
Pages that link here