Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Trying to get maven plugin working with m2e

That's Nexus UI screenshot :-)

Beware that Takari incrementalbuild library is rather low-level, requires invasive changes to your mojo code and, at the same time, quite easy to bypass (intentionally or otherwise). From my experience it is difficult to use correctly, especially when you need to "wrap" existing code generator that have not been designed upfront to work with the library.

At work we are investigating alternative approach, which we hope will be both less invasive and guarantee correct behaviour. We don't have anything ready for external use yet, but I'll likely post an update here when we do.

Almost forgot to mention. Takari library enables incremental behaviour both inside Eclipse/m2e and during command line build. Our new approach will support both environments too.

--
Regards,
Igor


On Tue, Oct 4, 2016, at 03:00 PM, Mike Samuel wrote:


On Tue, Oct 4, 2016 at 1:32 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
> You can see how m2e "maps" your plugin execution to Eclipse workspace
> build in project properties, under Maven, Lifecycle Mapping. Check that
> it says mapping=execute and source=maven-plugin there. You can also
> enable debug log and see if m2e logs anything interesting in
> .metadata/.plugins/org.eclipse.m2e.logback.configuration/.

Screenshot below, so it looks like this is what I needed.  You may have saved me a huge headache.  Thanks.






> Beware that there is generally no good way to integrate maven plugin
> execution in Eclipse workspace build. BuildContext you are trying to use
> does not clean obsolete generated files in some cases. There is also
Yeah.  I'm persisting state between compiles that includes lists of output files per bundle which lets me compute an obsolete set when the bundle set changes, but the compilers I'm linking together don't all report the files they produce which makes things brittle, and building into a temp space and coping outputs over has its own set of headaches.

> takari incrementalbuild library, which is very difficult to use
> correctly.

Thanks.  I'll look into that.

>
> --
> Regards,
> Igor
>
> On Tue, Oct 4, 2016, at 10:47 AM, Mike Samuel wrote:
>> I'm having trouble getting m2e to invoke my maven code generating
>> plugin[1].
>>
>> I've rewritten it to use BuildContext per [2] and I set up the
>> lifecycle-mapping-metadata.xml [3].
>>
>> With that, Eclipse complains about a demo project that includes the
>> plugin when I install a snapshot with syntax errors in the XML, so it
>> seems to be found, and I've got enough logging to see that m2e is
>> kicking off the maven-resources-plugin when a change a text file in
>> Eclipse, but my plugin doesn't seem to be invoked even though it works
>> fine from the command line.
>>
>> [4] references a plugin.xml, "The follow extension in plugin.xml
>> registers ANTLR project configurator with m2e," but I can't find where
>> that's supposed to go.  I see [5] but I'm not writing an
>> eclipse-plugin -- just piggybacking off m2e.
>>
>> Can someone take a look or is there a minimal project template that
>> shows how to integrate these things?  I trawled through the ANTLR4
>> plugin and found a lot of helpful stuff but haven't gotten things
>> wired up right yet.
>>
>> thanks, mike
>>
>>
>> [2] -
>> [3] -
>> [4] -
>> [5] -
>> _______________________________________________
>> m2e-users mailing list
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
> _______________________________________________
> m2e-users mailing list
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top