Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] generate-sources

For the code generation to work proper, the following has to happen

1. Java source folders created/configured for the generated code.
   this needs to happen during initial project import and whenever
   code generation configuration changes, which is probably never
   for majority of cases.
2. During incremental workspace build, changes that require code
   re/generation need to be detected, actual code generation has
   to be executed accordingly. Eclipse workspace needs to be
   notified of the changes to generated sources, so JDT and other
   relevant tools can do their work
3. During full/clean build, generated sources need to be wiped out,
   regenerated and Eclipse workspace needs to be notified of all that.

If you look at modello and antlr extensions, you'll see that most of the logic is already in generic. There are at least two missing parts to this puzzle

* m2e core needs to be extended to pass configuration parameters to m2e
  extensions based on information captured in pom.xml. For code
  generation this would be input and output patterns and likely if
  generation should be run on incremental build or during full/clean
  build only
* actual generic code generation extension needs to be written

After this is done, you will be able to "map" your private generation
plugin executions to this new generic code generation extension.

Feel free to open new enhancement request in m2e bugzilla, but at this
point I am not sure if we will have time to implement this before 1.0.
Quality patch attached to the bugzilla will make this likely, but long
CC list may be enough too.

As usual, we'll be happy to provide pointers on m2e-dev@xxxxxxxxxxx
mailing list if somebody wants to give this a try.

--
Regards,
Igor

On 11-01-21 02:54 PM, Benson Margulies wrote:
Hmm. Any thought about the shape of a generic extension that could be
configured to talk to any number of simple plugins that generate code?

On Fri, Jan 21, 2011 at 2:51 PM, Vlad Tatavu<vtatavu@xxxxxxxxxxxx>  wrote:
In 0.13.x u still need the extensions, only that u don't need to configure
"custom lifecycle mapping" anymore.

Vlad

On 1/21/2011 2:43 PM, Benson Margulies wrote:

I don't think that it makes sense for me to invest in building
extensions for my private code generation plugins for .12 if they are
no longer needed in .13. So I guess I waiting.

On Fri, Jan 21, 2011 at 2:11 PM, Igor Fedorenko<igor@xxxxxxxxxxxxxx>
  wrote:

Generally, code generation requires explicit support from one of
installed m2e extensions. There is currently support for modello and
antlr/antlr3 available from m2e-extras update site.

To make this work in m2e 0.12.x, you need to configure what we call
"custom lifecycle mapping" and you can find few examples in [1] and [2].

In m2e 0.13.x, code generation is expected to work without any
configuration in pom.xml or at least you should get clear error message
what additional m2e extensions are required.

[1]

https://github.com/sonatype/m2eclipse-extras/tree/0.12.0.20101103-1500/org.maven.ide.eclipse.modello.tests/projects/antlr
[2]

https://github.com/sonatype/m2eclipse-extras/tree/0.12.0.20101103-1500/org.maven.ide.eclipse.modello.tests/projects/modello

--
Regards,
Igor

On 11-01-21 02:04 PM, Benson Margulies wrote:

What all do I have to do so that M2E (a) runs generate-sources, and
(b) pays attention to additional source directories added by plugins
bound to that phase?

Can I add to the POM to record this permanently?
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top