Kanawish
unread,Dec 14, 2009, 4:32:33 PM12/14/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to maven-config-processor-users
I was running into a problem when trying to use the <add><file>
feature. Had to explore the code to figure out was going on, and I
think what I found might be of interest to others.
Basically, if you follow the example from the wiki, trying to inject
contents of my-other-config.xml in a bean:
<add>
<file>my-other-config.xml</file>
<inside>/beans/bean[@id='environmentBean']</inside>
<add>
you'll run into an exception the second you try to add more than one
outside xml in your new configuration. What happens underneath, far as
I figure, is, the plugin tries to see if it can find matches for tags
within the included files, on top of trying to parse your main
configuration input file.
All of this is good and important if you want your transformations to
apply on included files as well as the main input one. (And I figure
most people, like me, would want this behavior.)
But the trick missing from the doc is, you'll likely want to modify
your entries to read:
<add>
<file>my-other-config.xml</file>
<inside>/beans/bean[@id='environmentBean']</inside>
<strict>false</strict>
<add>
disabling "strict" processing, you shouldn't be getting an exception
during the recursive application of your transformation rules onto
your included xml files.
Hope this can be of some use to users of this plugin.
If I've missed a key page of documentation or a "gotcha" with my
suggestion, I'd sure like to hear about it.
Thank you!