Thanks Jesse for the pointer. Actually it is on central: http://repo2.maven.org/maven2/de/pdark/decentxml/1.3/
Regards, Julien ----- Message d'origine ---- > De : Jesse Glick <jesse.gl...@oracle.com> > À : dev@maven.apache.org > Envoyé le : Mer 13 avril 2011, 16h 00min 21s > Objet : Re: Maven API to partially edit pom.xml > > On 04/13/2011 07:56 AM, Julien HENRY wrote: > > 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, ...). > > The main challenge is finding a library for high-fidelity XML round-trip >structure editing, i.e. that preserves all details of whitespace and >formatting >for unmodified nodes. NetBeans has such a system (XAM/XDM) but the dependency >tree is too deep for use in a Maven plugin. >http://code.google.com/p/decentxml/ >is the only such small library I can find. It has its own model rather than >Document, DOMImplementationLS, etc., so your code would be tightly tied to >that >API. It does not appear to be published on Central and I am unsure how >reliable >it is, but it has a Maven POM utility already, and it seems to work as >advertised in my testing - replacing a few element attribute values on some >largish hand-edited XML files produced a minimal diff. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > For additional commands, e-mail: dev-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org