Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] m2e and AbstractMavenLifecycleParticipants



On 11-12-05 1:04 AM, Christopher Hunt wrote:
Hi Igor,

Thanks for the responses on this subject - I really appreciate them.

However I'm having difficulties still. You said:

m2e does not directly execute Maven build lifecycle, so
AbstractMavenLifecycleParticipant will not be called be default, at
least I do not believe it will.
On further investigation I concur, I do not believe that my
AbstractMavenLifecycleParticipant.afterProjectsRead method is invoked
from within m2e.

Do you think it should be i.e. should I raise a ticket on this?
AbstractMavenLifecycleParticipant is a Maven 3 feature that may be
reasonable to support.

m2e does not execute maven lifecycle, so I do not think it makes sense
to execute AbstractMavenLifecycleParticipant from m2e.


Have a look at ILifecycleMapping2 and AbstractMavenDependencyResolver.
AbstractMavenDependencyResolver.resolveProjectDependencies is called
right after m2e read MavenProject instance and I think it can be used to
execute AbstractMavenLifecycleParticipant.afterProjectsRead.
I've had a look, but I'm wondering if
AbstractMavenLifecycleParticipant.afterProjectsRead needs to be invoked
somewhere higher up i.e. after all projects have been read in
(parents/modules). In Maven, this method is invoked from
org.apache.maven.DefaultMaven as part of the doExecute of a
MavenExecutionRequest.


It is not possible to directly compare Maven command line build and what
happens inside Eclipse workspace, the two behave quite differently.
Although orchestration of some multi-project actions is possible inside
workspace, it is better to think about workspace projects as completely
independent.

On a related topic, how do I pull in the m2e libraries that I require in
my project. I tried the following but to no avail:

<dependency>
<groupId>org.eclipse.m2e</groupId>
<artifactId>org.eclipse.m2e.core</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>

...and...

<repositories>
<repository>
<id>eclipse</id>
<url>http://download.eclipse.org/releases/indigo</url>
<layout>p2</layout>
</repository>
<repository>
<id>m2e</id>
<url>http://download.eclipse.org/technology/m2e/releases/1.0</url>
<layout>p2</layout>
</repository>
</repositories>

Thanks again for your help. I feel I'm nearly there...

Have you read any of PDE documentation referenced from [1]? In short,
all dependencies must be defined in OSGi bundle manifest.

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

--
Regards,
Igor


Back to the top