First, the way to plug extra functionnality into Maven is to write a Maven
plugin so I don't think you can find a Maven plugin to be generic enough to
perform any kind of task.
For you purpose, you can try a Java annotation processor which are
supported by the Maven compiler plugin or a combination of the Maven exec
plugin (to launch your own generator) and the Maven build helper plugin (to
let Maven know that new files have been generated)

Regards
Jeff



On Wed, Feb 27, 2013 at 12:30 PM, christofer.d...@c-ware.de <
christofer.d...@c-ware.de> wrote:

> I just posted this to Stackoverflow, but after posting I realized, that I
> should have come here first :-(
>
>
> I am currently working on a project, that makes intense usage of code
> generation for various purposes. One generator generates SQL scripts from
> jpa entities. Another generates DTOs from pojos, another generates the
> JPA2.0 meta model, jet another generates some xml and schema files based on
> Java classes ... each generator works completely different needs to be
> configured differently.
>
> My question now is ... is there any generic maven code generator plugin
> out there with the following attributes:
>
>  *
> Creates a pojo model of a Java class (Names, Properties, Annotation,
> Methods ...)
>  *
> Uses templates for defining the output that uses the pojo model to
> generate any output.
>  *
> Allows me to specify multiple templates for one class
>  *
> Allows me to generate code and resources
>  *
> Allows me to generate a base class to target/generated-sources and a dummy
> implementation to src/main/java which simply extends the base class (If the
> dummy class in src/main/java exists, nothing happens, if it doesn't it
> generates such a dummy class. This code is checked in to the SCM and allows
> extending the generated classes manually)
>
> I am using the Flexmojos GraniteDS plugin for generating my ActionScript
> model code, but it's pretty specialized for that particular purpose.
>
> I think such a generic generator would make things a lot easier ... is
> there something like that available out there, or do I have to start
> implementing it myself?
>
> Chris
>



-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Reply via email to