Ok, I can try that. How can I get the dependencies of the current plugin? I
tried to get them with
pluginManager.getPluginDefinitionForPrefix("myprefix", session,
project).getDependencies() but that returned only an empty list.

Cheers,
Kai

2010/2/23 Stephen Connolly <[email protected]>

> depending on another maven plugin is a bad plan.  Due to issues with how
> Maven 2 loads plugins, the first version of a plugin loaded in a
> multi-module build is the only version that is loaded.
>
> Maven 3 will fix this somewhat, but in essence your build will be
> completely
> unpredictable if you try to depend on another plugin.
>
> IIRC getting the resolved dependencies is actually quite easy from within
> maven (just annotate the mojo with @requiresDependencyResolution scope
> where
> scope is the scope you require and then I think annotate a field with
> @parameter expression="${project.artifacts}" or something similar... you're
> making your life more complex by trying to depend on a separate plugin
>
> -Stephen
>
> On 22 February 2010 21:59, Kai Hackemesser <[email protected]
> >wrote:
>
> > Hi, James,
> >
> > that tip is almost good! But this one executes the mojo, and I want to
> have
> > the mojo object accessible, as I want to access a field. In more details,
> I
> > want to call the getResults() method on ResolveDependenciesMojo to get
> hold
> > of the dependencies.
> > The actual scenario: I want to build a classpath string containing some
> > dependencies of the plugin and the dependencies of the current project.
> Or
> > I
> > need a list of resolved jar files for the same set of dependencies.
> >
> > Cheers,
> > Kai
>

Reply via email to