Skip to content

Sonatype Nexus

Nexus는 Maven repository manager로 프로젝트 또는 기업에서 필요로 하는 내부 리포지토리 구성을 위한 도구이다.

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

구체적인 설정 방법은 Jetty#IPAccessHandler 항목을 참조.

Blacklist of Nexus 3.x version

Nexus 3.x 설정 방법은 아래와 같다.

  1. /opt/sonatype/nexus/etc/jetty 경로에 jetty-ipaccess.xml파일을 생성한 후
  2. /opt/sonatype/nexus/etc/nexus-default.properties파일에서 nexus-args속성에 ${jetty.etc}/jetty-ipaccess.xml를 추가하면 된다. (다중 인자는 ,를 사용하여 구분한다)
  3. 그리고 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