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

Hard to tell for sure without looking at the code, but you need to use
plexus-build-api for two reasons

1. Mojos that runOnIncremental=true (the default), will be executed for
any resource file, including all sources and generated files under
target/. For performance and stability reasons it is absolutely
essential to short-cut any time-consuming work if there are no changes
to the input sources processed by the mojo.

2. All resources changed by the mojo must be registered as such with
build context. This is how m2e knows what resources need to be refreshed
in workspace.

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

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).

--
Regards,
Igor

On 11-10-21 5:23 AM, Vegard B. Havdal wrote:

On Oct 20, 2011, at 3:58 PM, Igor Fedorenko wrote:

[2] http://wiki.eclipse.org/M2E_compatible_maven_plugins

Am testing this now, looks good. I have one question: After I have
installed my mojo's artifact (a generate-sources one), and then do
Run as->Maven generate sources, it does run (the missing lifecycle
config error gone, yay), but the Eclipse build path is not updated
automatically to include the new generated-sources folder, like I
think it did in 0.12.

Update project configuration does not add the folder to the build
path either.

Is this because of the thing you mention at the bottom of the wiki,
me not using plexus-build-api to update workspace resources from the
mojo, or should it work automatically?

I am mapping to execute, and runOnConfiguration is true.

I have m2e - Maven Integration for Eclipse	1.1.0.201110201603
org.eclipse.m2e.feature.feature.group	Eclipse.org - m2e

Vegard


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


Back to the top