maven-dev mailing list archives

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

> 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.

Regards,

-- 
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."
http://www.pdark.de/

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


Mime
View raw message