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/40ae4590 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40ae4590 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40ae4590 Branch: refs/heads/camel-2.18.x Commit: 40ae45902a2635b88cb7ecab6e8874a591d581f0 Parents: 3ae1e2a 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 16:46:37 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/40ae4590/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); } }