What I have done in a customer specific plugin, is to not have a
dependency on some library in the plugin itself but rely on it being
declared as a dependency in the Maven project where the plugin is
bound. That made it totally controllable by the project. I don't
remember the exact could, and my brain's still on summer vacation, but
I believe I created a classpath with the project's dependencies in the
plugin.

However, there are several drawbacks of that design:
* All versions of the library that you could possibly use have to be
API compatible (in theory good libraries are, but in reality...)
* You could force the project to declare a dependency for something
just used during build time (the project could have a dependency to
the API but you need the impl as well during build time for the
plugin) - as a Maven person I very much worry about this!

I wouldn't really recommend this solution, but rather think that the
best solution is to declare the dependencies where they should go. So
if a plugin has a dependency, it should be declared there.

/Anders

On Thu, Aug 2, 2012 at 10:38 AM, Jochen Wiedmann
<[email protected]> wrote:
> Hi,
>
> a plugins dependencies are usually hard coded in the plugins POM. I
> know, that the user can change the dependency version by configuring
> the plugins dependency list appropriately. However, I feel that that
> is somewhat inconvenient and would prefer to plugin a little bit more
> dynamic, for example by reading the dependency version from the
> projects dependency list. Can anayone point out to me, how to do that?
>
> Thanks,
>
> Jochen
>
> --
> In other words: what could be seen as a socially debilitating failure
> of character can certainly work to your advantage too. (Linus
> Torvalds, but the use in the signature tells something about me as
> well.)
>
> ---------------------------------------------------------------------
> 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