private void runPlugin() throws Exception {
    File rootDir = new File(camelCoreDir, pathToModelDir);
    Document document = XmlHelper.buildNamespaceAwareDocument(inputCamelSchemaFile);
    XPath xPath = XmlHelper.buildXPath(new CamelSpringNamespace());
    DomFinder domFinder = new DomFinder(document, xPath);
    DocumentationEnricher documentationEnricher = new DocumentationEnricher(document);
    Map<String, File> jsonFiles = PackageHelper.findJsonFiles(rootDir);

    NodeList elementsAndTypes = domFinder.findElementsAndTypes();
    documentationEnricher.enrichTopLevelElementsDocumentation(elementsAndTypes, jsonFiles);
    Map<String, String> typeToNameMap = buildTypeToNameMap(elementsAndTypes);
    Set<String> injectedTypes = new HashSet<String>();

    for (Map.Entry<String, String> entry : typeToNameMap.entrySet()) {
      String elementType = entry.getKey();
      String elementName = entry.getValue();
      if (jsonFileExistsForElement(jsonFiles, elementName)) {
        injectAttributesDocumentation(
            domFinder,
            documentationEnricher,
            jsonFiles.get(elementName),
            elementType,
            injectedTypes);
      }
    }

    saveToFile(document, outputCamelSchemaFile, XmlHelper.buildTransformer());
  }