To get the dependencies of the scope of the plugin on the method of executeyour custom Mojo, you need to loop over the assembly elements as follows:
Build build = super.getProject().getBuild();
if (null != build) {
List<Plugin> plugins = build.getPlugins();
for (Plugin plugin : plugins) {
List<Dependency> dependencies = plugin.getDependencies();
for (Dependency dependency : dependencies) {
getLog().info(dependency.getGroupId());
getLog().info(dependency.getArtifactId());
getLog().info(dependency.getVersion());
getLog().info(dependency.getClassifier());
getLog().info(dependency.getScope());
}
}
}
, , API Aether , .