You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nmaven-dev@incubator.apache.org by David D Johnson <dd...@novell.com> on 2007/12/21 18:56:17 UTC

maven-xsd-plugin multiple xsd files

Hi, 

I am trying to figure out how to use maven-xsd-plugin to generate a set of .cs files from a set of .xsd files.
I have tried multiple files in xsdFile, multiple xsdFile tags, multiple configure tags and and multiple plugin tags.
Some of those are tolerated but only generate one of the files.

This is on windows with VS2005.
xsd.exe will accept multiple files, but only if the filenames come last.  And then, it jams all the classes into one source file.

What I really need to have happen is for xsd to run once for each file.

Thanks for any advice,

==  dj



Re: maven-xsd-plugin multiple xsd files

Posted by Shane Isbell <sh...@gmail.com>.
Hi David,

The implementation of the plugin only accepts one xsdFile, so one approach
would be to put each xsd file in a different project. This would of course
generate a separate assembly for each model.

The XsdGeneratorMojo could be modified by 1) changing the xsdFile parameter
type to a list; 2) within the XsdGeneratorMojo.execute method, iterating
over the NetExecutable.execute method for each xsdFile, passing in an xsd
file path to the XsdGeneratorMojo.getCommands method.

This does assume that the URI remains the same for each model. If the URI
changes then you would need to create a separate class that stores a URI to
xsdFile mapping and place of list of these class types into a parameter
within the XsdGeneratorMojo, iterating over the NetExecutable.execute method
similar to above.

Regards,
Shane
On Dec 21, 2007 10:56 AM, David D Johnson <dd...@novell.com> wrote:

> Hi,
>
> I am trying to figure out how to use maven-xsd-plugin to generate a set of
> .cs files from a set of .xsd files.
> I have tried multiple files in xsdFile, multiple xsdFile tags, multiple
> configure tags and and multiple plugin tags.
> Some of those are tolerated but only generate one of the files.
>
> This is on windows with VS2005.
> xsd.exe will accept multiple files, but only if the filenames come last.
>  And then, it jams all the classes into one source file.
>
> What I really need to have happen is for xsd to run once for each file.
>
> Thanks for any advice,
>
> ==  dj
>
>
>