Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] On handling of generated code



On 11-10-21 7:49 AM, Vegard B. Havdal wrote:

On Oct 21, 2011, at 1:32 PM, Igor Fedorenko wrote:

I'll try to update the wiki with code samples later today or over
the weekend.


That would be very useful, thanks much in advance.



I've updated the wiki, let me know if something requires further
clarifications.

http://wiki.eclipse.org/M2E_compatible_maven_plugins


I already do project.addCompileSourceRoot(dir) from the Mojo, I need
Eclipse-specific stuff also if I am to configure m2e mapping using
lifecycle-mapping-metadata.xml, is that correct understanding?


project.addCompileSourceRoot(dir) is enough to add dir as source folder
to the project, but not enough to make generated sources actually appear
in workspace.

Also, m2e build lifecycle mapping only affects workspace build and
project configuration. RunAs->Maven executes maven in external
process and is not affected by the lifecycle mapping (and, frankly,
should not be used from workspace much).

Been doing that for years, it works well for the codegen plugins I am
using.


This maybe okay for an internal plugin used by a small closed group of
developers working together, but is bad for opensource maven plugins
with distributed and disconnected user base.

My biggest concern when we discussed embedding m2e lifecycle mapping
metadata in maven plugins was that maven plugin developers have very
little incentive to provide proper well tested m2e integration. I am
afraid that many maven plugins will ship with poorly implemented or
outright wrong m2e support. There will be no error messages about the
plugins any more, but they will either not work as expected by Eclipse
users (like in your case, code generation simply does not happen) or
cause end-less builds, resource leaks and so on. All these problems will
result in bugreports agains m2e and will require significant amount of
time to analyze.

We'll see how it goes...

--
Regards,
Igor


Back to the top