You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alban Linard <al...@lsv.ens-cachan.fr> on 2012/11/14 11:34:02 UTC
Plugin that depends on components from another plugin
Hello,
i am trying to create a maven plugin that makes use of another plugin
(archetype). The latter seems to heavily use plexus components.
I cannot find a way to load and use a component in archetype (see
example code attached). What did i wrong? Is it because the components
only exist in the maven dependency in my plugin? How can it work?
Thanks,
Alban Linard
Re: Plugin that depends on components from another plugin
Posted by Alban Linard <al...@lsv.ens-cachan.fr>.
> For all intents, you cannot use another plugin directly. But most
> plugins have extracted the useful bits into components which you CAN
> use.
That it what i am trying to do. In the source code, i try to use the
org.apache.maven.archetype.generator.ArchetypeGenerator component, found
in maven-archetype-plugin or archetype-common (don't remember which one).
> It might be simplest to just copy the archetype plugin source code,
> rename the groupId and artifactId (etc) in the pom, and use that as a
> base for your own plugin. What exactly are you trying to do in your
> plugin?
The plugin i write wraps the archetype creation with some checks and
some information retrieval. I already have an "working" version that
calls mvn archetype from the command line, but it is fragile when it
passes the properties as -D...=... Thus i would prefer to call the
ArchetypeGenerator directly.
Also i am interrested in knowing why the component cannot be created in
my example ;-)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Plugin that depends on components from another plugin
Posted by Wayne Fay <wa...@gmail.com>.
> i am trying to create a maven plugin that makes use of another plugin
> (archetype). The latter seems to heavily use plexus components.
For all intents, you cannot use another plugin directly. But most
plugins have extracted the useful bits into components which you CAN
use.
It might be simplest to just copy the archetype plugin source code,
rename the groupId and artifactId (etc) in the pom, and use that as a
base for your own plugin. What exactly are you trying to do in your
plugin?
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org