Repository: camel Updated Branches: refs/heads/master 1691c6237 -> f050545b3
CAMEL-10434: Camel catalog support different runtimes to provide their supported list of components etc. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b447ff0d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b447ff0d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b447ff0d Branch: refs/heads/master Commit: b447ff0d88a526df6e3bd0567ea616c9273337ff Parents: 1691c62 Author: Claus Ibsen <davscl...@apache.org> Authored: Mon Nov 7 15:19:30 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Mon Nov 7 15:19:30 2016 +0100 ---------------------------------------------------------------------- .../camel/maven/packaging/PrepareCatalogKarafMojo.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b447ff0d/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java ---------------------------------------------------------------------- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java index fc53c54..8ee7a15 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java @@ -509,10 +509,10 @@ public class PrepareCatalogKarafMojo extends AbstractMojo { } private Set<String> findKarafFeatures() throws MojoExecutionException, MojoFailureException { - Set<String> answer = new LinkedHashSet<>(); + // load features.xml file and parse it + Set<String> answer = new LinkedHashSet<>(); try { - // load features.xml file InputStream is = new FileInputStream(new File(featuresDir, "features.xml")); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -522,8 +522,8 @@ public class PrepareCatalogKarafMojo extends AbstractMojo { dbf.setValidating(false); dbf.setXIncludeAware(false); Document dom = dbf.newDocumentBuilder().parse(is); - NodeList children = dom.getElementsByTagName("features"); + NodeList children = dom.getElementsByTagName("features"); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeType() == ELEMENT_NODE) { @@ -531,10 +531,8 @@ public class PrepareCatalogKarafMojo extends AbstractMojo { for (int j = 0; j < children2.getLength(); j++) { Node child2 = children2.item(j); if ("feature".equals(child2.getNodeName())) { - // the name attribute is the maven artifact id of the component String artifactId = child2.getAttributes().getNamedItem("name").getTextContent(); if (artifactId != null && artifactId.startsWith("camel-")) { - // find the component name based on the artifact id answer.add(artifactId); } }