On 12/09/17 18:05, Adam Hardy wrote:
when I'm coding a mojo, if I call MavenProject's getArtifacts(), I can only get artifacts from the project level dependencies.

How do I obtain artifacts from a plugin's dependencies?

The question which comes to my mind: Why do you need the dependencies of your own ? Aren't the defined in your plugin's pom ?

Maybe I misunderstand a thing here?



Presumably I call something like project.getPlugin(key).getDependencies()?

If the 'key' required for project.getPlugin(key) is of the form myGroup:myPlugin:version e.g. com.megacorp:thing-plugin:1.0.2

can I get my mojo's own key programmatically in the mojo to avoid hard-coding it?


Can you please explain what you are trying to accomplish ?

The users of my plugin define a dependency which the mojo unpacks and extracts certain files from.

At the moment, I have coded the plugin to take the groupId and artifactId of this dependency via the mojo config.

This strikes me as doppel gemoppelt for the user to put that info in twice. I thought I could just enter it once as a plugin dependency in the user project pom - assuming it would be the only one.

Regards
Adam

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

Reply via email to