geronimo-xbean-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Mercelis <>
Subject Re: Multiple namespace support in maven-xbean-plugin?
Date Tue, 22 Jan 2013 15:22:23 GMT

I fixed the problem by adding just 1 extra check in the XBeanMojo.execute()
function; see patch in attachment.

I noticed following things in the code:
* It is possible to define a namespace per class you annotate with
@org.apache.xbean.XBean namespace=""
* If you don't add that parameter to the annotation; the namespace defined
in the pom.xml execution is used
* An xsd (and documentation file) is only created for the namespace you
define in the execution.
* but in the XBeanMojo an iteration is made over all namespaces that were
found by the QdoxMappingLoader; and the namespace that is iterated over
last, is the one that fills the .xsd and related files.

Resolution: I added a check that the namespace defined in the
maven-xbean-plugin is the same as the namespace currently being handled.
So If you have more than one namespace: use multiple executions in the
pom.xml and add namespace="..." to each @org.apache.xbean.XBean annotation.

The patch was created agains the 3.12 version of the source code.

Kind regards.

2013/1/21 Tom Mercelis <>

> Hello,
> I'm trying to have two namespaces defined in 1 maven bundle. I'm reading
> in that at version 3.4
> this had been implemented. But today with version 3.12; I'm getting similar
> problems with overwriting files:
> It seems in 1 execution, only 1 namespace can be defined. During the
> execution with this one namespace in the .pom, it does seem to process both
> my namespaces, I conclude this from the fact the the lines "Generating
> META-INF properties file:", "Generating Spring 2.0 handler mapping",
> "generating HTML", appear twice, once for each namespace I used with the
> different @org.apache.xbean.XBean namespace="..." annotations.
> I even see that for the second namespace, the output reads: "updating
> Spring 2.0 handler mapping" instead of generating. Which seems to be
> described in XBEAN-60.
> Unfortunately the HTML documentation, XSD file and WIKI documentation are
> overwritten with the information of the last namespace.
> Am I doing something wrong? Or is this functionality for XSD+HTML+WIKI
> file generation added later than the spring.handlers and is it not built
> for multiple namespace support?
> In attachment you should find the configuration of the plugin and the
> output of maven showing how it overwrites the same files for each namespace
> it processes. It creates to sets of identical files .xsd, .xsd.html,
> Kind regards,
> Tom Mercelis

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message