On 11/07/2009, at 1:32 AM, John Casey wrote:
Actually, I disagree. First, since the configurator attempts to
traverse the PlexusConfiguration and reflectively assign those
values to bean properties (or fields) in the wagon instance, this
means that a Wagon.class pass-through will have to be able to
somehow accommodate all possible configuration parameters that any
delegate would use. While we might be able to accomplish this by
making WagonDelegate implement MapOrientedComponent, we'd still have
to take those mapped variables and immediately start over again with
a new Configurator instance internally, so we could actually pass on
the configuration to the delegate.
Simply resolving the hint and looking up the correct wagon before
configuration takes place makes all of this much, much simpler.
Cool, I hadn't thought of that. It is still possible since the config
is mostly (and should be) the same between the two, but if you've
sorted out the below it doesn't make it worth it.
As for the POM ordering issue, we can avoid that simply by providing
a defaultRoleHints map configuration for the wagon manager and/or
the delegator class that looks up the wagon (initially, i had
factored out the Wagon-lookup functionality, but folded it back into
WagonManager in the end). Since maven-core redefines the lw and
httpclient http wagon components using things like 'http-sun', we
could configure the wagon manager to default over to 'http-sun' if
no sysprop is provided, then if the defaultRoleHints mapping doesn't
contain an entry for the protocol in question WagonManager could
lookup by the protocol itself.
Cool
I'd prefer the SysProp be checked in DefaultMaven (via the
execution properties), like maven.artifact.threads, and then a
method called on the wagon manager to set a default wagon impl
(when registerWagons is called).
I don't have any serious issue with moving the sysprop check; I just
figured it made more sense architecturally to have all of the
configuration logic for wagons in one place (as much as the api
separation allows).
While I realise 2.x isn't targeted to being embeddable, I thought it
seemed good to keep up with the same practices.
Thanks!
- Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]