Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Code generation requires 2 project builds

see inline.

--
Regards,
Igor


On 11-08-05 10:23 PM, Spencer Van Hoose wrote:
Hi,
I'm trying to get a custom Java code generation mojo to work with the
new m2e. Following the example on the Extension Development wiki page
<http://wiki.eclipse.org/M2E_Extension_Development> page, I created a
project configurator to run the mojo and then refresh the output folder.
When I configure a project and then build it in Eclipse the first build
fails because it can't find the generated code. It seems like the code
generation is running after the build completes which requires me to
build twice. Is this expected behavior or am I doing something wrong?


This is currently expected. Maven build runs after JDT Java builder, so
code generated by the Maven builder immediately triggers incremental
build (assuming workspace autobuild is on), during which generated
sources get compiled.

I'm also curious why setting the code generation mojo to <execute/> in
the pom (without using my plugin) prevents it from adding its output
directory as a source folder. I know this is not recommended but
shouldn't it act the same as it did under 0.12 when set to execute?


In m2e (and to a large degree in Eclipse in general) project
configuration and project build are two separate activities. Following
this pattern, <execute/> simply runs the mojo as part of the build, but
does not attempt to reflect execution output to the project configuration.


Thanks,
Spencer



Back to the top