Have a look a flatten-maven-plugin[1], which was implemented to rewrite the pom file.

Robert

[1] https://www.mojohaus.org/flatten-maven-plugin/

On Thu, 29 Nov 2018 17:11:12 +0100, Marc Rohlfs <[email protected]> wrote:

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to