Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Which is the best way to programmatically edit the pom.xml

Hello,
Suppose I need to programmatically modify the pom.xml file. Which is the recommended way?

I did some investigation, and noticed that there is an EMF model in plugin org.eclipse.m2e.model.editwhich is used in plugin org.eclipse.m2e.refactoring to do some refactoring operations. I also noticed that  in  plugin org.eclipse.m2e.core.ui, the method PomEdits.performOnDOMDocument(omEdits.OperationTuple... fileOperations) is used for changing the pom (for example, when adding dependencies). Finally, I noticed that m2e-wtp  uses classes from   org.apache.maven.model.*  like Model and Build, and classes like   org.codehaus.plexus.util.xml.Xpp3Dom


Thank you in advance.

Back to the top