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



On Tue, Oct 4, 2016 at 3:00 PM, Mike Samuel <mikesamuel@xxxxxxxxx> 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.


Sorry.  Wrong screen capture.



I think the source=workspace part is because Eclipse includes an m2e project that provides that plugin.  The mapping=ignore part explains why it isn't do anything, but I'm still not clear on why it's ignored.  AFAICT, my <pluginExecutionFilter> is fine.

~/work/closure-maven-plugin [16:22:44]> cat plugin/target/classes/META-INF/m2e/lifecycle-mapping-metadata.xml  | grep -A6 '<pluginExecutionFilter'
      <pluginExecutionFilter>
        <groupId>com.google.closure</groupId>
        <artifactId>closure-maven-plugin</artifactId>
        <goals>
          <goal>generate-closure-sources</goal>
        </goals>
      </pluginExecutionFilter>







 

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


> [6] https://github.com/takari/io.takari.incrementalbuild
>
> --
> 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
>>
>>
>> [1] - https://github.com/mikesamuel/closure-maven-plugin
>> [2] -
>> https://www.eclipse.org/m2e/documentation/m2e-making-maven-plugins-compat.html
>> [3] -
>> https://github.com/mikesamuel/closure-maven-plugin/blob/master/plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
>> [4] -
>> https://eclipse.org/m2e/documentation/m2e-extension-development.html
>> [5] -
>> https://wiki.eclipse.org/FAQ_What_is_the_plug-in_manifest_file_(plugin.xml)%3F
>> _______________________________________________
>> 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
> _______________________________________________
> 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