Merging web server plug-in configuration files from the command line

You can use the pluginUtility command to collect the automatically generated plug-in configuration files and merge them.

Procedure

  1. Make the plugin-cfg.xml files that you want to merge available to the merge tool.

    You can place the files in different directories or rename the files and copy them to a common directory. If you rename the files, keep plugin-cfg as part of the file name so that the merge tool finds them. For example, use the file name server1plugin-cfg.xml.

  2. Open a command line, and then change directory to the server_install_root/bin directory.
  3. Run the merge action of the pluginUtility command-line tool, which is available in the bin directory.

    Use the required --sourcePath option to specify a comma-separated list of files to merge or a single directory that contains all the files to merge. For example, if the plugin-cfg.xml files to merge are in two different directories, use a comma-separated list:

    pluginUtility merge --sourcePath=C:/plugins/plugin-cfg.xml,C:/other/plugin-cfg.xml

    If the plugin-cfg.xml files to merge are in one directory, use the directory name:

    pluginUtility merge --sourcePath=C:/plugins
    Tip: If the file path has spaces, you must enclose it in double quotation marks ("). For example, if the file path is C:\Program Files\myFiles, specify --sourcePath="C:/Program Files/myFiles" in the command.

    The tool merges the specified plug-in configuration files into a single file. By default, the file is created in the current directory with the name merged-plugin.xml. Optionally, you can use the --targetPath option to specify either a directory or a file into which to write the merged file. The following example specifies a target directory and file name:

    pluginUtility merge --sourcePath=C:/plugins --targetPath=C:/targetDir/myMergedPluginCfg.xml

Example

One directory contains two plug-in configuration files:

  • server_install_root/usr/plugin/serverA-plugin.xml
  • server_install_root/usr/plugin/serverB-plugin.xml

Run the pluginUtility command from the server_install_root/bin directory. Specify that the tool write the merged file to the same directory as the plug-in configuration files to be merged.

pluginUtility merge --sourcepath=../usr/plugin --targetpath=../usr/plugin

The tool creates the merged plug-in file, and writes the following messages:

Merging the plugin files with the pattern *plugin-cfg*.xml from the directory ../usr/plugin. 

The file plugin-cfgA.xml is selected for the merging. 

The file plugin-cfgB.xml is selected for the merging. 

Generating the merged configuration file at ../usr/plugin/merged-plugin-cfg.xml.

Generated the merged configuration file successfully

For more information about command options, see pluginUtility command.