You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dinesh Pandey <Di...@india.techspan.com> on 2005/04/26 11:44:46 UTC

Using Maven's Castor Plugin

Hi,

 

I am trying to use the Maven's castor plugin for source code generation
based on xsd file.

When I see the documentation it talks about only one goal
castor:prepare-filesystem.

It also talks about a tag called castor:generate but its not clear how do I
use this tag into my project.

Could someone please help me with this?

 

Thanks in advance,

Dinesh

 

 


Re: Using Maven's Castor Plugin

Posted by Guillaume Laforge <gl...@gmail.com>.
Hello Dinesh,

You'll have to:

- create a maven.xml (if you don't have already one).

- define a new goal a bit like that:

  <goal name="my:castor">
    <attainGoal name="castor:prepare-filesystem"/>
    <castor:generate schema="${basedir}/xsd/some.xsd"
package="com.foo.bar" types="j2"/>
  </goal>

- call that goal before java:compile with:

  <preGoal name="java:compile">
    <attainGoal name="ae6-web:castor"/>
  </preGoal>

- you may have to use the castorbuilder.properties file to make some
namespace/package mappins if you don't use the package attribute
(especially if you have some more complex multi-file xsd system)

And you should be done!

Guillaume

On 26/04/05, Dinesh Pandey <Di...@india.techspan.com> wrote:
> Hi,
> 
> I am trying to use the Maven's castor plugin for source code generation
> based on xsd file.
> 
> When I see the documentation it talks about only one goal
> castor:prepare-filesystem.
> 
> It also talks about a tag called castor:generate but its not clear how do I
> use this tag into my project.
> 
> Could someone please help me with this?
> 
> Thanks in advance,
> 
> Dinesh
> 
> 


-- 
Guillaume Laforge
http://glaforge.free.fr/weblog/?catid=2

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