private static @Nullable String getJpsLibraryVersion(@NotNull Module module,
                                                       @NotNull String mavenCoords,
                                                       @Nullable Attributes.Name versionAttribute) {
    String name = StringUtil.substringAfter(mavenCoords, ":");
    if (name == null) return null;

    Ref<String> result = new Ref<>();
    OrderEnumerator.orderEntries(module).recursively()
      .forEachLibrary(library -> {
        VirtualFile[] libraryFiles = library.getFiles(OrderRootType.CLASSES);
        for (VirtualFile libraryFile : libraryFiles) {
          if (matchLibraryName(sanitizeLibraryName(libraryFile.getNameWithoutExtension()), name)) {
            VirtualFile jarFile = JarFileSystem.getInstance().getVirtualFileForJar(libraryFile);
            if (jarFile == null) continue;

            String version = JarUtil.getJarAttribute(VfsUtilCore.virtualToIoFile(jarFile), Attributes.Name.IMPLEMENTATION_VERSION);
            if (version == null && versionAttribute != null) {
              version = JarUtil.getJarAttribute(VfsUtilCore.virtualToIoFile(jarFile), versionAttribute);
            }
            if (version != null) {
              result.set(version);
              return false;
            }
          }
        }
        return true;
      });
    return result.get();
  }
private static @Nullable String getJpsLibraryVersion(@NotNull Module module,
                                                       @NotNull String mavenCoords,
                                                       @Nullable Attributes.Name versionAttribute)