Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] build-before-launch ? background m2e task ?

Igor:

I need to produce updated SCR descriptor (plugin reads java annotations and produces SCR xml)
http://felix.apache.org/site/apache-felix-service-component-runtime.html#ApacheFelixServiceComponentRuntime-MavenSCRPlugin

before launch of an app;

maven invocation : org.apache.felix:maven-scr-plugin:scr

(also need same functionality for org.apache.felix:maven-bundle-plugin:manifest)

Thank you,

Andrei

-------- Original Message  --------
Subject: Re: [m2e-dev] build-before-launch ? background m2e task ?
From: Igor Fedorenko <igor@xxxxxxxxxxxxxx>
To: m2e-dev@xxxxxxxxxxx
Date: Wed 12 Oct 2011 10:55:22 PM CDT
As far as I know, the proper way to provide build-before-launch
behaviour is by implementing
ILaunchConfigurationDelegate2.buildForLaunch. Unfortunately this
requires new launch configuration type and won't work for standard
RunAs->JavaApplication and similar.

ILaunchListener API does not seem to allow for long-running operations,
i.e. no IProgressMonitor is passed in. You should still be able to run
your goals from ILaunchListener.launchAdded... but this will be a hack
in my opinion.

What goal do you want to execute? Maybe I can suggest alternative approach.

--
Regards,
Igor

On 11-10-12 10:52 PM, Andrei Pozolotin wrote:
    Igor:

    1) this would be the "build-before-launch" api :-)

    http://wiki.eclipse.org/FAQ_What_is_a_launch_configuration%3F
    http://wiki.eclipse.org/FAQ_How_do_I_launch_a_Java_program%3F
    http://www.eclipse.org/articles/Article-Launch-Framework/launch.html

    http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/debug.htm
    http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/debug/core/ILaunchManager.html

    2) I guess the logic in m2e extension would be:
    * get current list of ILaunchConfiguration from ILaunchManager;
    * subscribe itself as ILaunchListener;
    * when launch event is fired: get current ILaunch, find main(...)
    class from ILaunch;
    * find all workspace open maven projects that main() project depends on;
    * run maven goals in these projects;
    * allow launch to proceed;

    do you think this is feasible?

    Thank you,

    Andrei



-------- Original Message --------
Subject: Re: [m2e-dev] build-before-launch ? background m2e task ?
From: Igor Fedorenko <igor@xxxxxxxxxxxxxx>
To: m2e-dev@xxxxxxxxxxx
Date: Wed 12 Oct 2011 05:19:15 PM CDT
See inline.

--
Regards,
Igor

On 11-10-12 5:17 PM, Andrei Pozolotin wrote:
Hello;

1) I am developing a m2e extension on the lines of:
http://wiki.eclipse.org/M2E_Extension_Development

2) In need to cover 2 executions:

a) http://felix.apache.org/site/apache-felix-maven-scr-plugin-use.html
org.apache.felix:maven-scr-plugin:scr

b)
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
org.apache.felix:maven-bundle-plugin:manifest

QUESTIONS:

A) I need to run both of the above goals right before java
application launch via eclipse launcher;
(I do not want to run them on incremental build)
how m2e gives access to "build-before-launch" JDT event?


Can you provide some documentation pointers or other information that
explains how to implement build-before-launch "handler"?

B) if there is no m2e access to "build-before-launch" JDT event,
can I run these goals on background, in async thread pool w/o
blocking m2e builder invocation?
(so incremental build just serves as a trigger for background rebuild)


This really depends on what you need to do. If your project configurator
needs access to workspace, especially change any workspace resources, it
will likely be easier to run this code as part of a builder. If the code
does not make any changes to workspace, it is probably be okay to run
this as a background job.

C) maven-bundle-plugin life cycle is already mapped by some other
m2e extension;
(I receive "conflicting life cycle mappings" error)
how can I override that? how can I find which other extension is
doing that?


m2e-tycho provides mapping for maven-bundle-plugin bundle and manifest
goals. Either uninstall m2e-tycho project configurator or force use of
your project configurator from pom.xml file.


[1] http://wiki.eclipse.org/M2E_plugin_execution_not_covered


Thank you,

Andrei



_______________________________________________
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




_______________________________________________
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