docs: @SuppressFBWarnings(value = "DMI_COLLECTION_OF_URLS", justification = "Plugin loading happens only once on Jenkins startup")
      protected static void addDependencies(URL hpiResUrl, String fromPath, Set<URL> dependencySet) throws URISyntaxException, MalformedURLException {
          if (dependencySet.contains(hpiResUrl)) {
              return;
          }
  
          Manifest manifest = parsePluginManifest(hpiResUrl);
          String dependencySpec = manifest.getMainAttributes().getValue("Plugin-Dependencies");
          if (dependencySpec != null) {
              String[] dependencyTokens = dependencySpec.split(",");
              ServletContext context = Jenkins.getActiveInstance().servletContext;
  
              for (String dependencyToken : dependencyTokens) {
                  if (dependencyToken.endsWith(";resolution:=optional")) {
                      // ignore optional dependencies
                      continue;
                  }
  
                  String[] artifactIdVersionPair = dependencyToken.split(":");
                  String artifactId = artifactIdVersionPair[0];
                  VersionNumber dependencyVersion = new VersionNumber(artifactIdVersionPair[1]);
  
                  PluginManager manager = Jenkins.getActiveInstance().getPluginManager();
                  VersionNumber installedVersion = manager.getPluginVersion(manager.rootDir, artifactId);
                  if (installedVersion != null && !installedVersion.isOlderThan(dependencyVersion)) {
                      // Do not downgrade dependencies that are already installed.
                      continue;
                  }
  
                  URL dependencyURL = context.getResource(fromPath + "/" + artifactId + ".hpi");
  
                  if (dependencyURL == null) {
                      // Maybe bundling has changed .jpi files
                      dependencyURL = context.getResource(fromPath + "/" + artifactId + ".jpi");
                  }
  
                  if (dependencyURL != null) {
                      // And transitive deps...
                      addDependencies(dependencyURL, fromPath, dependencySet);
                      // And then add the current plugin
                      dependencySet.add(dependencyURL);
                  }
              }
          }
      }