2008/12/18 Mansour <mansou...@yahoo.com>

> Jörg Schaible wrote:
> > Mansour wrote at Donnerstag, 18. Dezember 2008 10:32:
> >
> >
> >> Hello all,
> >> I need to extend (use) an existing maven plugin from my plugin. How do I
> >> proceed, or where do I start ? is there any links ? To be more specific,
> >> I need to extend the docbkx maven plugin to generate docbook output. In
> >> my own, I need to customize the style sheet, header,....etc and wrap it
> >> all in a package for consistency between generated documents. Any advice
> ?
> >>
> >
> > In short: Don't do it.
> >
> > Maven loads every plugin only once. If you depend on a different plugin,
> you
> > also specify its version in the dependencies. This has the unfortunate
> > result, that either the user-specified version for that plugin is ignored
> > or the the version you defined in your dependency.
> I though I can ignore the version in the POM so that m plugin will use

the latest.
>

> > The used version is
> > simply defined by the sequence Maven loads the plugin (either because the
> > user uses it directly or your plugin is used and it will load in
> > consequence the other one). If the version does not match, the user might
> > get some strange effects especially if the versions are not compatible.
> >
> > - Jörg
> >
>
> OK, What alternatives do I have, then. I thought maven2 plugins are
> reusable and they can be used from another plugins. What do other plugin
> authors do in this case ?


The idea is to develop plugins so that most (if not all) the work is
performed in a regular jar artifact... that way, to extend the plugin you
just depend on the jar file not the plugin.

What you therefore want to do is ensure that the plugin you need to extend
is refactored so that 99.9% of the code in the mojo is moved into a separate
module, then you just depend on that module.

>
>
> Thank you.
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to