Skip to content
Search

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

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:

  1. Download and store the file at NEXUS_HOME/conf/jetty-ipaccess.xml, with the same permissions as the other jetty files
  2. 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
  3. Edit NEXUS_HOME/bin/jsw/conf/wrapper.conf, and reference the new jetty file as an app parameter ie wrapper.app.parameter.3=./conf/jetty-ipaccess.xml ( 3 by default, however the next available number must be used )
  4. restart Nexus

See Jetty#IPAccessHandler for the detailed configuration.

Blacklist of Nexus 3.x version

The configuration for Nexus 3.x is as follows.

  1. Create a jetty-ipaccess.xml file in the /opt/sonatype/nexus/etc/jetty path,
  2. then add ${jetty.etc}/jetty-ipaccess.xml to the nexus-args property in the /opt/sonatype/nexus/etc/nexus-default.properties file. (Separate multiple arguments with ,)
  3. Then reboot Nexus.

Upload artifact

$ curl --fail -u admin:admin123 --upload-file foo.jar 'http://my-nexus-server.com:8081/repository/my-raw-repo/'

See also

Favorite site

Guide

author Zer0 sitemap