The Release Plugin does rewrite branch/version and does an exceptionally bad 
job since you have to manually configure the indention. Would be good to have a 
common utility for that.

Gruss
Bernd
--
http://bernd.eckenfels.net

________________________________
Von: Marc Rohlfs <[email protected]>
Gesendet: Freitag, November 30, 2018 1:42 AM
An: [email protected]
Betreff: How to rewrite POMs retaining the XML structure

Hi all,

is there a way to rewrite pom.xml files without loosing formatting,
ordering and comments?

We need to (programmatically) do several changes on Maven POMs, e.g. adding
and removing dependencies and properties. Currently we're using
the MavenXpp3Reader and MavenXpp3Writer classes to read and write the
pom.xml files, but in the output files, all comments are removed, the XML
nodes are reordered and formatting (indentations, empty lines) is lost.
Does anybody know a way how to read and write POM files without loosing
formatting ordering and comments?

Best regards
Marc

Reply via email to