Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


The XML replacements option allows you to modify XML files of your container's configuration using XPath statements.

This feature is only available for standalone local containers.


In some cases, it is necessary to modify XML files of your container. This can be done using Cargo's xmlReplacements option, accessible via the Cargo APIs.

You might for example want to modify the defaultHost for your Tomcat instance.

Example using the Java API

Some notes:

  • The attributeName parameter is optional -if you don't specify it, then Cargo will replace directly the value of the node
  • If the value corresponds to an existing configuration property (such as cargo.hostname for example) then Cargo will reuse it from the configuration
  • Finally, there is another parameter ignoreIfNonExisting which, when set to TRUE, will make the XML replacement tool ignore if that specific XPath doesn't exist in the XML file

Example using the ANT tasks

Example using the Maven 2 plugin

  • No labels