ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );
private File getDependencyFile(ComponentDependency dep) { ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler(dep.getType()); Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), null, dep.getType(), null, artifactHandler); return getArtifactFile(artifact); }
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; }
private void writeDependencyElement( ComponentDependency dependency, XMLWriter w ) { w.startElement( "dependency" ); String groupId = dependency.getGroupId(); element( w, "groupId", groupId ); String artifactId = dependency.getArtifactId(); element( w, "artifactId", artifactId ); String type = dependency.getType(); if ( type != null ) { element( w, "type", type ); } String version = dependency.getVersion(); element( w, "version", version ); w.endElement(); }
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );
private void writeDependencyElement( ComponentDependency dependency, XMLWriter w ) { w.startElement( "dependency" ); String groupId = dependency.getGroupId(); element( w, "groupId", groupId ); String artifactId = dependency.getArtifactId(); element( w, "artifactId", artifactId ); String type = dependency.getType(); if ( type != null ) { element( w, "type", type ); } String version = dependency.getVersion(); element( w, "version", version ); w.endElement(); }
public static ComponentSetDescriptor buildComponentSet( PlexusConfiguration c, ClassRealm realm ) throws PlexusConfigurationException { ComponentSetDescriptor csd = new ComponentSetDescriptor(); // ---------------------------------------------------------------------- // Components // ---------------------------------------------------------------------- PlexusConfiguration[] components = c.getChild( "components" ).getChildren( "component" ); for (PlexusConfiguration component : components) { csd.addComponentDescriptor(buildComponentDescriptorImpl(component, realm)); } // ---------------------------------------------------------------------- // Dependencies // ---------------------------------------------------------------------- PlexusConfiguration[] dependencies = c.getChild( "dependencies" ).getChildren( "dependency" ); for (PlexusConfiguration d : dependencies) { ComponentDependency cd = new ComponentDependency(); cd.setArtifactId(d.getChild("artifact-id").getValue()); cd.setGroupId(d.getChild("group-id").getValue()); String type = d.getChild("type").getValue(); if (type != null) { cd.setType(type); } cd.setVersion(d.getChild("version").getValue()); csd.addDependency(cd); } return csd; }
private void validateConfiguration( ComponentSetDescriptor componentSetDescriptor ) throws ComponentDescriptorCreatorException { List dependencies = componentSetDescriptor.getDependencies(); if ( dependencies == null ) { return; } for ( Iterator it = dependencies.iterator(); it.hasNext(); ) { ComponentDependency dependency = (ComponentDependency) it.next(); if ( StringUtils.isEmpty( dependency.getGroupId() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'groupId'." ); } if ( StringUtils.isEmpty( dependency.getArtifactId() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'artifactId'." ); } if ( StringUtils.isEmpty( dependency.getVersion() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'version'." ); } if ( StringUtils.isEmpty( dependency.getType() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'type'." ); } } }
/** * @param dependencies not null list of <code>Dependency</code> * @return list of component dependencies */ public static List<ComponentDependency> toComponentDependencies( List<Dependency> dependencies ) { List<ComponentDependency> componentDeps = new LinkedList<>(); for ( Dependency dependency : dependencies ) { ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( dependency.getArtifactId() ); cd.setGroupId( dependency.getGroupId() ); cd.setVersion( dependency.getVersion() ); cd.setType( dependency.getType() ); componentDeps.add( cd ); } return componentDeps; }
/** * @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 dependencies not null list of <code>Dependency</code> * @return list of component dependencies */ public static List toComponentDependencies( List dependencies ) { List componentDeps = new LinkedList(); for ( Iterator it = dependencies.iterator(); it.hasNext(); ) { Dependency dependency = (Dependency) it.next(); ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( dependency.getArtifactId() ); cd.setGroupId( dependency.getGroupId() ); cd.setVersion( dependency.getVersion() ); cd.setType( dependency.getType() ); componentDeps.add( cd ); } return componentDeps; }
/** * @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 dependencies not null list of <code>Dependency</code> * @return list of component dependencies */ public static List toComponentDependencies( List dependencies ) { List componentDeps = new LinkedList(); for ( Iterator it = dependencies.iterator(); it.hasNext(); ) { Dependency dependency = (Dependency) it.next(); ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( dependency.getArtifactId() ); cd.setGroupId( dependency.getGroupId() ); cd.setVersion( dependency.getVersion() ); cd.setType( dependency.getType() ); componentDeps.add( cd ); } return componentDeps; }
/** * @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(); }
private File getThisPluginAsDependency() { ComponentDependency dep = new ComponentDependency(); dep.setGroupId(plugin.getGroupId()); dep.setArtifactId(plugin.getArtifactId()); dep.setVersion(plugin.getVersion()); return getDependencyFile(dep); }
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifact-id" ).getValue() ); cd.setGroupId( d.getChild( "group-id" ).getValue() ); cd.setType( type ); cd.setVersion( d.getChild( "version" ).getValue() );
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );