private static void addExtensionMetaFromAllFiles(File targetDirectory, List<String> runtimeClasspathElements,
                                                     Log logger, boolean includeOrigin,
                                                     List<NamespaceMetaData> namespaceMetaDataList)
            throws MojoFailureException, MalformedURLException {
        List<File> jarFiles = new ArrayList<>();
        listOfJarFiles(targetDirectory.getAbsolutePath(), jarFiles);
        // +1 to include the module's target folder
        int urlCount = runtimeClasspathElements.size() + jarFiles.size() + 1;
        // Creating a list of URLs with all project dependencies
        URL[] urls = new URL[urlCount];
        int index = 0;
        for (; index < runtimeClasspathElements.size(); index++) {
            try {
                urls[index] = new File(runtimeClasspathElements.get(index)).toURI().toURL();
            } catch (MalformedURLException e) {
                throw new MojoFailureException("Unable to access project dependency: "
                        + runtimeClasspathElements.get(index), e);
            }
        }

        for (int j = 0; index < urlCount - 1; index++, j++) {
            try {
                urls[index] = jarFiles.get(j).toURI().toURL();
            } catch (MalformedURLException e) {
                throw new MojoFailureException("Unable to access project dependency: "
                        + runtimeClasspathElements.get(index), e);
            }
        }

        // Adding the generated classes to the class loader
        urls[urlCount - 1] = targetDirectory.toURI().toURL();
        ClassLoader urlClassLoader = AccessController.doPrivileged(
                (PrivilegedAction<ClassLoader>) () -> new URLClassLoader(
                        urls, Thread.currentThread().getContextClassLoader()
                )
        );

        Iterable<Class<?>> extensions = ClassIndex.getAnnotated(Extension.class, urlClassLoader);
        for (Class extension : extensions) {
            addExtensionMetaDataIntoNamespaceList(namespaceMetaDataList, extension, logger, includeOrigin);
        }
    }
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