The following sections describe the various directories that
are a part of any Nexus installation. When you install Nexus Open Source
or Nexus Professional, you are creating two directories: a directory which
contains the Nexus runtime and application, and a directory which contains
your own configuration and data. When you upgrade to a newer version of
Nexus, you replace the Nexus application directory and retain all of your
own custom configuration and repository data in
sonatype-work/.
The sonatype-work/ directory is
installed as a sibling to the nexus application directory, and the
location of this directory can be configured via the
plexus.properties file which is described in Section 3.10.2, “Nexus Configuration Directory”. Figure 3.11, “The Sonatype Nexus Work Directory” shows the Sonatype Nexus work
directory with the conf/ directory expanded.
The Sonatype Nexus work directory contains the following subdirectories:
backup/-
If you have configured a scheduled job to backup Nexus configuration, this directory is going to contain a number of ZIP archives that contain snapshots of Nexus configuration. Each ZIP file contains the contents of the
conf/directory. (Automated backups are a feature of Nexus Professional.) conf/-
This directory contains the Nexus configuration. Settings that define the list of Nexus repositories, the logging configuration, the staging and procurement configuration, and the security settings are all captured in this directory.
indexer/-
Contains a Nexus index for all repositories and repository groups managed by Nexus. A Nexus index is a Lucene index which is the standard for indexing and searching a Maven repository. Nexus maintains a local index for all repositories, and can also download a Nexus index from remote repositories.
logs/-
Stores the
nexus.logfile: the log file that contains information about a running instance of Nexus. This directory also contains archived copies of Nexus log files. Nexus log files are rotated every day. To reclaim disk space, you can delete old log files from thelogs/directory. p2/-
If you are using the P2 repository management features of Nexus Professional, this directory contains a local cache of P2 repository artifacts.
proxy/-
Stores data about the files contained in a remote repository. Each proxy repository has a subdirectory in the
proxy/attributes/directory and every file that Nexus has interacted with in the remote repository has an XML file which captures such data as the: last requested timestamp, the remote URL for a particular file, the length of the file, and the digests for a particular file among other things. If you need to backup the local cached contents of a proxy repository, you should also back up the contents of the proxy repository's directory underproxy/attributes/. storage/-
Stores artifacts and metadata for Nexus repositories. Each repository is a subdirectory which contains the artifacts in a repository. If the repository is a proxy repository, the storage directory will contain locally cached artifacts from the remote repository. If the repository is a hosted repository, the storage directory will contain all artifacts in the repository. If you need to backup the contents of a repository, you should backup the contents of the storage directory.
template-store/-
Contains templates for default repositories. If you examine the XML files in this directory, you will see that they contain default templates for each different type of repository. For example, the
repository-default_proxy_release.xmlfile contains defaults for a Proxy repository with a release policy. timeline/-
Contains an index which Nexus uses to store events and other information to support internal operations. Nexus uses this index to store feeds and history.
trash/-
If you have configured scheduled jobs to remove snapshot artifacts or to delete other information from repositories, the deleted data will be stored in this directory. To empty this trash folder, view a list of Nexus repositories, and then click on the Trash icon in the Nexus user interface.
The conf/ directory contains a number of
files which allow for configuration and customization of Nexus. All of
the files contained in this directory are altered by the Nexus
administrative user interface. While you can change the configuration
settings contained in these files with a text editor, Sonatype
recommends that you modify the contents of these files using the Nexus
administrative user interface.
- l
og4j.properties -
Contains Log4J configuration, if you need to customize the detail of log messages, the frequency of log file rotation, or if you want to connect your own, custom Log4J appenders, you would alter this configuration file.
lvo-plugin.xml-
Contains configuration for the latest version plugin. This XML file contains the location of the properties file which Nexus queries to check for a newer version of Nexus.
nexus.xml-
The bulk of the configuration of Nexus is contained in this file. This file maintains a list of repositories, and all server-wide configuration like the SMTP settings, security realms, repository groups, targets, and path mappings.
pgp.xml-
Contains PGP key server configuration.
nexus-obr-plugin.properties-
Contains configuration for the Nexus OSGi Bundle repository plugin in Nexus Professional.
procurement.xml-
Contains configuration for the Nexus Procurement plugin in Nexus Professional.
security.xml-
Contains security information about users and roles in Nexus.
staging.xml-
Contains configuration for the Nexus Staging plugin in Nexus Professional.
After installing Nexus Professional, you will have a
nexus-professional-webapp-1.9.1.1/
directory and a sonatype-work/ directory, and after
installing Nexus Open Source, you will have a
nexus-webapp-1.9.1.1/ directory and a
sonatype-work/ directory. This section details the
contents of the conf directory that is shown in
Figure 3.12, “Nexus Professional Configuration Directory”. This directory contains
configuration for the Jetty servlet container. You will only need to
modify the files in this directory if you are customizing the
configuration of Plexus, the Jetty servlet container, or the behavior of the scripts
that start Nexus.
The files and folders contained in this directory are:
classworlds.conf-
Defines the order in which resources and classes are loaded from the classpath. It is unlikely that even the most advanced Nexus users will ever need to customize the contents of this file.
plexus.properties-
This file contains configuration variables which control the behavior of Plexus and the Jetty servlet container. If you are customizing the port and host that Nexus will listen to, you would change the
application-portandapplication-hostproperties defined in this file. If you wanted to customize the location of the Sonatype work directory, you would modify the value of thenexus-workproperty in this configuration file. plexus.xml-
Defines the class names and configuration of components which are loaded by Plexus at startup. This file should never be changed as all configurable values have been removed from this file and placed in
plexus.properties. jetty.xml-
If this file is present in the
conf/directory, it will be used to configure Jetty.
The conf/examples/ directory contains sample
Jetty configuration files which can be used to customize the behavior of
the Jetty servlet container:
jetty.xml-
contains a
jetty.xmlsample with no customizations. This sample file listens on the${application-port}defined inplexus.properties. jetty-ajp.xml-
Contains a
jetty.xmlsample which will configure Nexus to listen on an AJP port 8009. This configuration can be used if you are proxying your Nexus server with web server which understands the AJP protocol such as Apache httpd with the mod_proxy_ajp module. jetty-dual-ports-with-ssl.xml-
Contains a
jetty.xmlsample which configures Nexus to listen on both the${application-port}and${application-port-ssl}(as defined inplexus.properties). This sample configuration also contains the SSL redirect rule. jetty-faster-windows.xml-
Contains a
jetty.xmlsample which configures a response buffer size that will address performance issues on Windows 2003 Server, for more information about this fix see the Jetty Wiki. jetty-header-buffer.xml-
Contains a
jetty.xmlsample which increases theheaderBufferSizeto 8k from the default of 4k. Documentation about the header buffer size can be found on the Jetty Wiki. jetty-simple-https-proxy.xml-
Contains a
jetty.xmlsample which should be used if you are proxying a Nexus instance with a web server that is handling SSL. For example, if you were proxying Nexus with Apache httpd server using mod_ssl you would use this configuration to configure the JettyRewriteHandler. jetty-ssl.xml-
Contains a
jetty.xmlsample which will only serve SSL encrypted content from${application-port}(as defined inplexus.properties).
The conf/examples/proxy-https/ directory
contains two files: apache2.conf and
jetty.xml. apache2.conf
contains sample mod_ssl and mod_proxy directives to configure Apache httpd to handle
SSL, and jetty.xml contains the
required Jetty configuration to configure Nexus to operate behind a
proxy that is handling SSL.

