code: protected PluginRelease findReleaseForPlugin(String id, String version) throws PluginException {
          PluginInfo pluginInfo = getPluginsMap().get(id);
          if (pluginInfo == null) {
              log.info("Plugin with id {} does not exist in any repository", id);
              throw new PluginException("Plugin with id {} not found in any repository", id);
          }
  
          if (version == null) {
              return getLastPluginRelease(id);
          }
  
          for (PluginRelease release : pluginInfo.releases) {
              if (versionManager.compareVersions(version, release.version) == 0 && release.url != null) {
                  return release;
              }
          }
  
          throw new PluginException("Plugin {} with version @{} does not exist in the repository", id, version);
      }
docs: Resolves Release from id and version.
  
  @param id of plugin
  @param version of plugin or null to locate latest version
  @return PluginRelease for downloading
  @throws PluginException if id or version does not exist