ex.printStackTrace();
	protected void buildPlugin(File descriptor) throws BuildException {		final PluginDescriptorModel descr;		try {			final XMLElement root = new XMLElement(new Hashtable(), true, false);			try {				final FileReader r = new FileReader(descriptor);				try {					root.parseFromReader(r);				} finally {					r.close();				}			} catch (IOException ex) {				throw new BuildException("Building " + descriptor + " failed", ex);			} catch (XMLParseException ex) {				throw new BuildException("Building " + descriptor + " failed", ex);			}			descr = new PluginDescriptorModel(root);		} catch (PluginException ex) {			throw new BuildException("Building " + descriptor + " failed", ex);		}		final String fullId = descr.getId() + "_" + descr.getVersion();		File destFile = new File(todir, fullId + ".jar");		final Jar jarTask = new Jar();		jarTask.setProject(getProject());		jarTask.setTaskName(getTaskName());		jarTask.setDestFile(destFile);		jarTask.setCompress(false);		// Add plugin.xml		final File tmpPluginDir;		final File tmpPluginXmlFile;		try {			tmpPluginDir = new File(tmpDir, "jnode-plugins" + File.separator + fullId);			tmpPluginDir.mkdirs();			tmpPluginXmlFile = new File(tmpPluginDir, "plugin.xml");			FileUtils.newFileUtils().copyFile(descriptor, tmpPluginXmlFile);			FileSet fs = new FileSet();			fs.setDir(tmpPluginDir);			fs.createInclude().setName("plugin.xml");			jarTask.addFileset(fs);		} catch (IOException ex) {			throw new BuildException(ex);		}		// Add runtime resources		final Runtime rt = descr.getRuntime();		if (rt != null) {			final HashMap fileSets = new HashMap();			final Library[] libs = rt.getLibraries();			for (int l = 0; l < libs.length; l++) {				processLibrary(jarTask, libs[l], fileSets, getPluginDir());			}		}		jarTask.execute();	}