public static List<NamespaceMetaData> getExtensionMetaData(String targetDirectoryPath,
                                                               List<String> runtimeClasspathElements,
                                                               Log logger, boolean includeOrigin,
                                                               boolean loadFromAllJars)
            throws MojoFailureException, MojoExecutionException {
        List<NamespaceMetaData> namespaceMetaDataList = new ArrayList<>();
        File targetDirectory = null;
        try {
            if (loadFromAllJars) {
                targetDirectory = new File(targetDirectoryPath);
                addExtensionMetaFromAllFiles(targetDirectory, runtimeClasspathElements, logger, includeOrigin,
                        namespaceMetaDataList);
            } else {
                targetDirectory = new File(targetDirectoryPath
                        + File.separator + Constants.CLASSES_DIRECTORY);
                addExtensionMetaFromClassFiles(targetDirectory, runtimeClasspathElements, logger, includeOrigin,
                        namespaceMetaDataList);
            }
        } catch (MalformedURLException e) {
            throw new MojoExecutionException("Invalid classes directory: " + targetDirectory.getAbsolutePath(), e);
        }
        for (NamespaceMetaData aNamespaceMetaData : namespaceMetaDataList) {
            for (List<ExtensionMetaData> extensionMetaData : aNamespaceMetaData.getExtensionMap().values()) {
                Collections.sort(extensionMetaData);
            }
        }
        Collections.sort(namespaceMetaDataList);
        return namespaceMetaDataList;

    }
Returns the extension extension meta data
Gets the meta data from the siddhi manager

@param targetDirectoryPath The path of the target directory of the maven module containing extensions
@param logger              The maven plugin logger
@param includeOrigin
@param loadFromAllJars
@return NamespaceMetaData namespace meta data list
@throws MojoFailureException   If this fails to access project dependencies
@throws MojoExecutionException If the classes directory from which classes are loaded is invalid
modules/siddhi-doc-gen/src/main/java/io/siddhi/doc/gen/core/utils/DocumentationUtils.java