Hi Mark,

I didn't follow whether you got a response on MNG-2771, but your approach is right (ie, follow wagon).

Basically:
1) use contextualizable to grab the plexus container
2) lookup conflict resolvers by role hint (a pom/settings property might be a good way to trigger this)
3) use the conflict resolver you want

You may want to create a conflict resolver factory to do these bits, and then call on it to get the desired resolver by role hint just to avoid adding the contextualizable bit to the existing classes - not sure if that's an issue or not.

Cheers,
Brett

On 26/06/2007, at 2:06 AM, Mark Hobson wrote:

On 24/06/07, Brett Porter <[EMAIL PROTECTED]> wrote:
Sorry :(

At the time, the repository data (mostly converted from m1) wasn't
suited to it and you got things you didn't expect. I always expected
you'd be able to turn it on and manage the dependencies properly but
the implementation of that didn't happen.

Yeah, thought it may be a hangover from the early days.. :(

Can you pull this off through the <extensions> tag in the POM as
Kenney suggested? It seems reasonable, and if so, then I feel a
little more comfortable with it.

This would be ideal, but I couldn't get it working in 2.0.x.  I
assumed this only worked in 2.1, but I've just tried and couldn't get
it working in that either.  If Kenney, or someone familiar with
MNG-2771, could validate my approach:

1) maven-artifact/META-INF/plexus/components.xml defines:
  a) ConflictResolver implementations with various role-hints,
including default
  b) ArtifactCollector implementation with default ConflictResolver
as a requirement
2) my project declares an extension jar that just contains a
META-INF/plexus/components.xml that redefines the ConflictResolver
implementation for default role-hint

In both 2.0.x and 2.1 the extension components.xml doesn't appear to
override the Maven components.xml.

An alternative, and preferred, method of configuration would be to use
role-hints to switch conflict resolvers, similar to Wagon.  I'm not
overly familiar with Plexus enough to know the best way to implement
this - if DefaultArtifactCollector requires a ConflictResolver, how
could a role-hint be positioned to switch the implementation used
during composition?  Also, how could this role-hint be configured in
the POM without changing the schema?

I don't really want to expose any functionality that requires a
customised Maven to run a project, though - that seems like we're
putting something in that will only be used by you :) It'll likely
break building other projects using that installation, or not being
able to build the projects on a different installation (Without hints
to help). If you're happy using a customised Maven, maybe you're best
building your own branch off the latest 2.0.x that includes the patch?

Sure, but I'd like to see if we could get extensions working first.

I'm still all for rolling it onto trunk and putting in example
projects that let us see this in action and help drive the use cases
for it going forward.

Cheers,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to