How do I get a plugin dependency from the project object in my mojo?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

How do I get a plugin dependency from the project object in my mojo?

I've got another question about mojo development.

Sorry for cross-posting, but I've put it here too:

I created a maven plugin and I implement my plugin in the projects where I need it like below.

Note that I left the test project doesn't have any dependencies. But part of the job the plugin has to do is to retrieve a zip dependency and extract a couple of files.

I use


and loop thro it to find that zip dependency.

If I put the dependency xml in the plugin dependencies, the plugin can't find it.

If I move the dependency xml to the dependencies for the test project, it works, but I don't think the dependency should be there. According to the maven plugin docs

    dependencies: Dependencies are seen a lot within the POM, and are an element under all plugins element blocks. The dependencies have the same structure and function as under that base build. The major difference in this case is that instead of applying as dependencies of the project, they now apply as dependencies of the plugin that they are under. The power of this is to alter the dependency list of a plugin, perhaps by removing an unused runtime dependency via exclusions, or by altering the version of a required dpendency. See above under Dependencies for more information.

So I want the dependency isolated to the plugin. I might want to run the plugin more than once and use a different dependency.

How can I get the build->plugins->plugin dependency, instead of relying on the base project?

<project xmlns=""