Customizing Jetty Using Multiple Configuration Files

This article describes a feature specific to Nexus 2.8+ and newer. (NEXUS-6153)

Nexus uses Eclipse Jetty as it's container. Earlier versions of Nexus loaded all of the Jetty configuration from one jetty.xml file, typically found at NEXUS_HOME/conf/jetty.xml.

Jetty users are used to providing a list of jetty XML config files which are merged to form the final configuration. As an advanced configuration option, Nexus now supports this merging concept in it's launcher code as of Nexus 2.8.

How it Works

A Nexus Administrator user can specify additional jetty XML configuration files to load to form the final configuration.

For the standard distribution bundle, these files can be specified using special properties located in NEXUS_HOME/bin/jsw/conf/wrapper.conf.

Look for these lines:
# add more indexed app parameters...

Any of the files located at NEXUS_HOME/conf/jetty-*.xml can be specified as part of the property, where n is the next highest number not already used. See the Java Service Wrapper for more information about this property. This provides a simpler method to add configuration for https and JMX, simply by adjusting a few properties.

If you create new jetty configuration files, make sure they match the naming convention of starting with jetty- and ending with .xml, and are located inside of NEXUS_HOME/conf/. This ensures that when generating a support bundle, these files are included.

Do not use the NEXUS_HOME/conf/examples/jetty-*.xml example files from older Nexus installations. These can cause problems as they were intended to be standalone files that could not be merged into other files.

Have more questions? Submit a request


Article is closed for comments.