use of org.apache.maven.plugin.descriptor.PluginDescriptor in project intellij-community by JetBrains.
the class CustomPluginDescriptorCache method patchedClone.
private static PluginDescriptor patchedClone(PluginDescriptor pluginDescriptor) {
if (pluginDescriptor == null)
return null;
PluginDescriptor clone = clone(pluginDescriptor);
clone.setDependencies(new ArrayList<ComponentDependency>(pluginDescriptor.getDependencies()));
return clone;
}
use of org.apache.maven.plugin.descriptor.PluginDescriptor in project maven-plugins by apache.
the class AggregatorJavadocReportTest method lookupMojo.
private JavadocReport lookupMojo(File testPom) throws Exception {
JavadocReport mojo = (JavadocReport) lookupMojo("aggregate", testPom);
PluginDescriptor pluginDescriptor = new PluginDescriptor();
pluginDescriptor.setPlugin(new Plugin());
setVariableValueToObject(mojo, "plugin", pluginDescriptor);
return mojo;
}
use of org.apache.maven.plugin.descriptor.PluginDescriptor in project maven-plugins by apache.
the class JavadocJarTest method lookupMojo.
private JavadocJar lookupMojo(File testPom) throws Exception {
JavadocJar mojo = (JavadocJar) lookupMojo("jar", testPom);
PluginDescriptor pluginDescriptor = new PluginDescriptor();
pluginDescriptor.setPlugin(new Plugin());
setVariableValueToObject(mojo, "plugin", pluginDescriptor);
return mojo;
}
use of org.apache.maven.plugin.descriptor.PluginDescriptor in project camel by apache.
the class RunMojo method determineRelevantPluginDependencies.
/**
* Determine all plugin dependencies relevant to the executable. Takes
* includePlugins, and the executableDependency into consideration.
*
* @return a set of Artifact objects. (Empty set is returned if there are no
* relevant plugin dependencies.)
* @throws MojoExecutionException
*/
private Set<Artifact> determineRelevantPluginDependencies() throws MojoExecutionException {
Set<Artifact> relevantDependencies;
if (this.includePluginDependencies) {
if (this.executableDependency == null) {
getLog().debug("All Plugin Dependencies will be included.");
relevantDependencies = new HashSet<Artifact>(this.pluginDependencies);
} else {
getLog().debug("Selected plugin Dependencies will be included.");
Artifact executableArtifact = this.findExecutableArtifact();
Artifact executablePomArtifact = this.getExecutablePomArtifact(executableArtifact);
relevantDependencies = this.resolveExecutableDependencies(executablePomArtifact, false);
}
} else {
getLog().debug("Only Direct Plugin Dependencies will be included.");
PluginDescriptor descriptor = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
try {
relevantDependencies = artifactResolver.resolveTransitively(MavenMetadataSource.createArtifacts(this.artifactFactory, descriptor.getPlugin().getDependencies(), null, null, null), this.project.getArtifact(), Collections.emptyMap(), this.localRepository, this.remoteRepositories, metadataSource, new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME), Collections.emptyList()).getArtifacts();
} catch (Exception ex) {
throw new MojoExecutionException("Encountered problems resolving dependencies of the plugin " + "in preparation for its execution.", ex);
}
}
return relevantDependencies;
}
use of org.apache.maven.plugin.descriptor.PluginDescriptor in project sofa-ark by alipay.
the class RepackageMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (this.project.getPackaging().equals("war")) {
getLog().debug("repackage goal could not be applied to war project.");
return;
}
if (this.project.getPackaging().equals("pom")) {
getLog().debug("repackage goal could not be applied to pom project.");
return;
}
if (StringUtils.isSameStr(this.arkClassifier, this.bizClassifier)) {
getLog().debug("Executable fat jar should be different from 'plug-in' module jar.");
return;
}
if (this.skip) {
getLog().debug("skipping repackaging as configuration.");
return;
}
/* version of SOFA ark container packaged into fat jar follows the plugin version */
PluginDescriptor pluginDescriptor = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
arkVersion = pluginDescriptor.getVersion();
repackage();
}
Aggregations