Package io.quarkus.maven.utilities
Class PomTransformer
- java.lang.Object
-
- io.quarkus.maven.utilities.PomTransformer
-
public class PomTransformer extends Object
A utility to transformpom.xmlfiles on the DOM level while keeping the original comments and formatting also on places where commonjavax.xml.transform.Transformerorjavax.xml.parsers.DocumentBuilderbased solutions tend to fail, such as- Order of XML declaration attributes
- Whitespace after the XML declaration
- Line breaks between element attributes
- File final whitespace
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPomTransformer.Gavtcsstatic interfacePomTransformer.TransformationA transformation of a DOMstatic classPomTransformer.TransformationContextA context of a set ofPomTransformer.Transformations.
-
Constructor Summary
Constructors Constructor Description PomTransformer(Path path, Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtransform(PomTransformer.Transformation... transformations)Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.voidtransform(Collection<PomTransformer.Transformation> transformations)Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.
-
-
-
Method Detail
-
transform
public void transform(PomTransformer.Transformation... transformations)
Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.- Parameters:
transformations- thePomTransformer.Transformations to apply
-
transform
public void transform(Collection<PomTransformer.Transformation> transformations)
Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.- Parameters:
transformations- thePomTransformer.Transformations to apply
-
-