List of usage examples for org.apache.maven.plugin.descriptor PluginDescriptor getPlugin
public Plugin getPlugin()
From source file:com.ariatemplates.attester.maven.ArtifactExtractor.java
License:Apache License
public void execute() throws MojoExecutionException, MojoFailureException { try {/*from w w w.j a va 2 s . c om*/ Map<?, ?> context = getPluginContext(); PluginDescriptor pluginDescriptor = (PluginDescriptor) context.get("pluginDescriptor"); Model projectModel = project.getModel(); for (Dependency dependency : pluginDescriptor.getPlugin().getDependencies()) { if ("zip".equalsIgnoreCase(dependency.getType())) { String outputDirectory = inplaceExtractDependency(session.getLocalRepository(), dependency); projectModel.addProperty(getPropertyName(dependency), outputDirectory); } } } catch (Exception e) { throw new MojoExecutionException("Error", e); } }