Hi,

I would like to know if there is a standard Maven API to edit parts of a 
pom.xml. I managed to parse a pom to a Model using ModelBuilder. Then I can do 
some modifications and write Model to file using ModelWriter. But of course it 
will completly rewrite the pom (loosing comments, writing unwanted tags like 
default values, ...).
I looked at how versions-maven-plugin works and it seems it uses its own parser 
(based on StAX) and then proceed with XPath to edit specific parts of the pom.
Is it still the recommended way? Is there a better solution with Maven 3 API?

Basically what I want is something like:

Model model = new Model("path/to/pom.xml");
model.setGroupId("foo");
model.write(); // Only groupId is changed in pom.xml


Thanks

Julien


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to