Use of the <strict></strict> tag.

18 views
Skip to first unread message

Kanawish

unread,
Dec 14, 2009, 4:32:33 PM12/14/09
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!

Leandro de Oliveira

unread,
Dec 15, 2009, 6:31:20 AM12/15/09
to maven-config-p...@googlegroups.com
Thank you for pointing this out.
I'll update the wiki ASAP.

2009/12/14 Kanawish <etienn...@gmail.com>:
> --
>
> You received this message because you are subscribed to the Google Groups "maven-config-processor-users" group.
> To post to this group, send email to maven-config-p...@googlegroups.com.
> To unsubscribe from this group, send email to maven-config-process...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/maven-config-processor-users?hl=en.
>
>
>
Reply all
Reply to author
Forward
0 new messages