Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Can a m2e compatible plugin register a folder as Eclipse project source folder?

Ah, it's the runOnConfiguration that does this. I checked the
connector's code I couldn't figure out what it did differently than my
plugin.

May I suggest this update to the wiki page to clarify this:

change this:
"If <runOnConfiguration/> set to true, corresponding maven mojos will
be executed as part of project import and configuration update. This
is necessary for mojos that make changes to MavenProject instance and
expect these changes to be available to other maven plugins. For
example, most code generation plugins, like modello or antlr3, add new
source directories to MavenProject instance and need to have
<runOnConfiguration/> set to true."

to something like this:
"If <runOnConfiguration/> set to true, corresponding maven mojos will
be executed as part of project import and configuration update. This
is necessary for mojos that make changes to MavenProject instance and
expect these changes to be available to other maven plugins. It will
also trigger m2e to update the Eclipse project accordingly. For
example, most code generation plugins, like modello or antlr3, add new
source directories to MavenProject instance and need to have
<runOnConfiguration/> set to true. m2e will then update the Eclipse
project to use these directories as source folders."

/Anders

On Mon, Aug 6, 2012 at 2:37 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
> Yes, I've added this in 1.1 and it is documented in [1]. You basically
> need to map plugin mojo(s) to <execute> with runOnConfiguration=true. No
> need to do anything special in the mojo, just add the source folders to
> MavenProject instance and m2e will do the rest.
>
>
> [1] http://wiki.eclipse.org/M2E_compatible_maven_plugins
>
>
> --
> Regards,
> Igor
>
>
> On 12-08-06 8:31 AM, Anders Hammar wrote:
>>
>> For a Maven plugin written to be m2e compatible, is it possible to
>> register a folder (a folder with generated sources for example) as a
>> source folder of the current Eclipse project? I *think* I've seen this
>> happen when using a m2e connector for this plugin.
>>
>> /Anders
>> _______________________________________________
>> m2e-dev mailing list
>> m2e-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>>
> _______________________________________________
> m2e-dev mailing list
> m2e-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-dev


Back to the top