maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Digulla <>
Subject Re: POM rewriting with DecentXML
Date Tue, 05 Aug 2008 12:09:12 GMT
Quoting Milos Kleint <>:

> how do you deal with newly added content? just overwriting a value for
> existing elements is relatively easy.
> I mean if I add a new dependency to the pom file, how do I make sure
> it's properly indented? That's been the major issue for me now with
> the jdom modello writer (which I wrote). I don't really care if it
> screws up attribute spacing, but newly added content needs to fit in.

The most simple solution is to search for an existing dependency and  
then copy any whitespace before it plus the dependency itself and then  
overwrite the text content of groupId, etc, of the copy.

If that doesn't work, search for an element in the same level as  
"dependency", "dependencies", etc., check the whitespace before that  
and duplicate it as necessary.


Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message