public static @Nullable MavenCoordinates getMavenCoordinates(@NotNull Library library) {
    if (library instanceof LibraryEx) {
      LibraryProperties<?> libraryProperties = ((LibraryEx)library).getProperties();
      if (libraryProperties instanceof LibraryWithMavenCoordinatesProperties) {
        return ((LibraryWithMavenCoordinatesProperties)libraryProperties).getMavenCoordinates();
      }
    }

    ProgressManager.checkCanceled();

    var name = library.getName();
    if (name == null) return null;

    var coordinatesString = StringUtil.substringAfter(name, ": ");
    if (coordinatesString == null) return null;

    var parts = StringUtil.split(coordinatesString, ":");
    if (parts.size() < 3) return null;

    return new MavenCoordinates(intern(parts.get(0)),
                                intern(parts.get(1)),
                                intern(parts.get(parts.size() - 1)));
  }
public static @Nullable MavenCoordinates getMavenCoordinates(@NotNull Library library)