Change POM settings from plugin code

I recently started writing Maven plugins and wondered if there is a general way to change values ​​in a file pom.xml, for example. change the version number of artifacts. With the exception of the modified line, I would like to keep the remaining formatting in the xml file. I'm about to start manually doing this through the Java DOM libraries, but first I want to check if there are any Maven convenience / features for this convenience.

Thanks.

+5
source share
2 answers

My advice: check how this is done in the maven-release-plugin . Actually, the interesting parts are in the maven-release-manager . Get sources and dig :)

+1
source

I do not think that there is a prescribed way to manipulate the pump. All the plugins I've seen and written use one of the many DOM libraries. The docs for the XOM Serializer explicitly state that it respects all spaces, unless otherwise indicated.

+1
source

All Articles