Class XmlService

java.lang.Object
org.apache.maven.api.xml.XmlService
Direct Known Subclasses:
DefaultXmlService

public abstract class XmlService extends Object
Comprehensive service interface for XML operations including node creation, merging, reading, and writing.

This class provides XML merging functionality for Maven's XML handling and specifies the combination modes that control how XML elements are merged.

The merger supports two main types of combinations:

  • Children combination: Controls how child elements are combined
  • Self combination: Controls how the element itself is combined

Children combination modes (specified by combine.children attribute):

  • merge (default): Merges elements with matching names
  • append: Adds elements as siblings

Self combination modes (specified by combine.self attribute):

  • merge (default): Merges attributes and values
  • override: Completely replaces the element
  • remove: Removes the element

For complex XML structures, combining can also be done based on:

  • ID: Using the combine.id attribute
  • Keys: Using the combine.keys attribute with comma-separated key names
Since:
4.0.0