private static <P extends JpsElement> void loadArtifact(JpsProject project, JpsArtifactService service, ArtifactState state, JpsArtifactPropertiesSerializer<P> serializer) {
    JpsPackagingElement rootElement = loadPackagingElement(state.getRootElement());
    if (rootElement != null) {
      List<ArtifactPropertiesState> propertiesList = state.getPropertiesList();
      JpsArtifact artifact = service.addArtifact(project, state.getName(), (JpsCompositePackagingElement)rootElement,
                                                 serializer.getType(), serializer.loadProperties(propertiesList));
      artifact.setBuildOnMake(state.isBuildOnMake());
      artifact.setOutputPath(state.getOutputPath());
      for (ArtifactPropertiesState propertiesState : propertiesList) {
        JpsArtifactExtensionSerializer<?> extensionSerializer = getExtensionSerializer(propertiesState.getId());
        if (extensionSerializer != null) {
          loadExtension(extensionSerializer, artifact, propertiesState.getOptions());
        }
      }
    }
  }
private static <P extends JpsElement> void loadArtifact(JpsProject project, JpsArtifactService service, ArtifactState state, JpsArtifactPropertiesSerializer<P> serializer)