Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Upgrade project to to latest Wagon, Aether provider and API



On Fri, Aug 10, 2012 at 3:21 PM, Benjamin Bentmann <bentmann@xxxxxxxxxxxx> wrote:
Thomas Sant'ana wrote:

I did some investigation with regards to the Wagon and there is a
dependency that should be injected and obviously is not there. Do you know
of any way to get around having to have the entire Plexus to get this
dependency injected? Works fine with 1.0

For completeness let's mention one solution is to simply not upgrade the wagon provider, you said yourself "Works fine with 1.0".

I did some hacking around this and 2.2 has some nice features (like total size to download). 

I did manage to get the dependency set using this in my manual wagon.

      LightweightHttpWagon wagon = new LightweightHttpWagon();
      Field authenticator = LightweightHttpWagon.class.getDeclaredField("authenticator");
      authenticator.setAccessible(true);
      authenticator.set(wagon, new LightweightHttpWagonAuthenticator());

Seems to work, maybe a bit brittle. But does work. 

 
Other than that, the field in question wasn't accessible via a public setter IIRC, so if you want to continue with the manual wiring approach, you will have to manually construct that missing dependency/component as well and use reflection to get it into the wagon instance.



Benjamin
_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aether-users


Back to the top