}
}
}
public void fillDependencies(Collection<File> files, Document doc) {
Element rootElement = Helper.getFirstElement(doc.getElementsByTagName("dependencies"));
NodeList nodeList = rootElement.getElementsByTagName("dependency");
for (int i = 0; i < nodeList.getLength(); i++) {
Node n = nodeList.item(i);
if (n.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
Element element = (Element) n;
boolean include = true;
StringBuilder path = new StringBuilder(mavenRepoPath);
StringBuilder jarName = new StringBuilder();
String groupId = Helper.getFirstElement(element.getElementsByTagName("groupId")).getTextContent();
for (String str : groupId.split("\\.")) {
path.append('/');
path.append(str);
}
String artifactId = Helper.getFirstElement(element.getElementsByTagName("artifactId")).getTextContent();
path.append('/');
path.append(artifactId);
jarName.append(artifactId);
jarName.append('-');
// if version is not explicitely set => NPE!
Element versionElement = Helper.getFirstElement(element.getElementsByTagName("version"));
String versionString = replaceProperty(versionElement.getTextContent());
path.append('/');
path.append(versionString);
jarName.append(versionString);
jarName.append(".jar");
Element scopeElement = Helper.getFirstElement(element.getElementsByTagName("scope"));
if (scopeElement != null) {
if (!"compile".equals(scopeElement.getTextContent()) && !"system".equals(scopeElement.getTextContent())) {
include = false;
}
if ("system".equals(scopeElement.getTextContent())) {
Element sysPath = Helper.getFirstElement(element.getElementsByTagName("systemPath"));
if (sysPath != null) {
path.setLength(0);
jarName.setLength(0);
path.append(replaceProperty(sysPath.getTextContent()));
}
}
}
if (include) {