private static JpsArtifact findParentArtifact(JpsElement element) {
    if (element instanceof JpsElementBase) {
      JpsElementBase parent = ((JpsElementBase<?>)element).getParent();
      if (parent instanceof JpsArtifact) {
        return (JpsArtifact)parent;
      }
      if (parent != null) {
        return findParentArtifact(parent);
      }
    }
    return null;
  }
private static JpsArtifact findParentArtifact(JpsElement element)