Using the configuration dropins folder to specify server configuration

You can specify additional configuration files in the configDropins directory without specifying include elements in the server.xml file.


  1. Create a configDropins directory under the usr/servers/server_name directory.
    • usr/servers/server_name/configDropins/overrides

      If you want to add configuration files to replace anything in the server.xml file of the server, create a configDropins/overrides directory. For example, to change ports that are defined in the server.xml, use a configDropins/overrides directory.

    • usr/servers/server_name/configDropins/defaults

      If you want the server.xml file to be the main configuration, but want to specify defaults for elements that the server.xml does not define, create a configDropins/defaults directory. For example, if you want developers to be able to provide configuration, but you want the server.xml to be the main configuration and you do not want the server.xml changed, use a configDropins/defaults directory.

  2. Place the server configuration files in either the configDropins/overrides or configDropins/defaults directory.

    Both directories are monitored for updates so that when you add, remove, or update configuration files, the runtime configuration is updated dynamically.

    If there are any conflicts, the following rules determine precedence:

    • The configuration that is specified in the configDropins/overrides directory takes precedence over the configuration in the server.xml file. Configuration specified in server.xml file takes precedence over configuration that is specified in the configDropins/defaults directory.
    • Configuration from files in both the configDropins/defaults and configDropins/overrides directories take precedence over any default configuration that is specified by a feature.
    • The configuration files in the dropins directory are processed in alphabetical order. A later configuration overrides an earlier one. As an example, if configDropins/defaults contains a.xml, b.xml and c.xml, the configuration from c.xml takes precedence over b.xml, and b.xml takes precedence over a.xml.
    Note: To maintain consistency across platforms, file names are converted to lowercase before sorting alphabetically. This means that if two files are specified in the same dropins directory that have the same name except for case variations (such as extraConfig.xml and ExtraConfig.xml), the ordering behavior is indeterminate.
  3. Optional: Turn off configuration monitoring. See Controlling dynamic updates.