protected static PluginDescriptor clone( PluginDescriptor original ) { PluginDescriptor clone = null; if ( original != null ) { clone = new PluginDescriptor(); clone.setGroupId( original.getGroupId() ); clone.setArtifactId( original.getArtifactId() ); clone.setVersion( original.getVersion() ); clone.setGoalPrefix( original.getGoalPrefix() ); clone.setInheritedByDefault( original.isInheritedByDefault() ); clone.setName( original.getName() ); clone.setDescription( original.getDescription() ); clone.setRequiredMavenVersion( original.getRequiredMavenVersion() ); clone.setPluginArtifact( ArtifactUtils.copyArtifactSafe( original.getPluginArtifact() ) ); clone.setComponents( clone( original.getMojos(), clone ) ); clone.setId( original.getId() ); clone.setIsolatedRealm( original.isIsolatedRealm() ); clone.setSource( original.getSource() ); clone.setDependencies( original.getDependencies() ); } return clone; }
private List<File> getThisPluginDependencies() { return plugin.getDependencies().stream().map(this::getDependencyFile).collect(Collectors.toList()); }
protected boolean isTychoP2Plugin(PluginDescriptor pluginDescriptor) { if (pluginDescriptor.getArtifactMap().containsKey("org.eclipse.tycho:tycho-p2-facade")) { return true; } for (ComponentDependency dependency : pluginDescriptor.getDependencies()) { if ("org.eclipse.tycho".equals(dependency.getGroupId()) && "tycho-p2-facade".equals(dependency.getArtifactId())) { return true; } } return false; }
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); for ( Iterator it = pluginDescriptor.getDependencies().iterator(); it.hasNext(); ) { ComponentDependency dep = (ComponentDependency) it.next(); w.startElement( "dependency" ); PluginUtils.element( w, "groupId", dep.getGroupId() ); PluginUtils.element( w, "artifactId", dep.getArtifactId() ); PluginUtils.element( w, "type", dep.getType() ); PluginUtils.element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); for ( Iterator it = pluginDescriptor.getDependencies().iterator(); it.hasNext(); ) { ComponentDependency dep = (ComponentDependency) it.next(); w.startElement( "dependency" ); PluginUtils.element( w, "groupId", dep.getGroupId() ); PluginUtils.element( w, "artifactId", dep.getArtifactId() ); PluginUtils.element( w, "type", dep.getType() ); PluginUtils.element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }
if (pluginDescriptor.getArtifactMap().isEmpty() && pluginDescriptor.getDependencies().isEmpty()) {
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); @SuppressWarnings( "unchecked" ) List<ComponentDependency> deps = pluginDescriptor.getDependencies(); for ( ComponentDependency dep : deps ) { w.startElement( "dependency" ); element( w, "groupId", dep.getGroupId() ); element( w, "artifactId", dep.getArtifactId() ); element( w, "type", dep.getType() ); element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }