@Override
 protected void addInvalidModuleEntry(JpsModule rootModel, boolean exported, String moduleName) {
   final JpsElementFactory elementFactory = JpsElementFactory.getInstance();
   final JpsDependenciesList dependenciesList = rootModel.getDependenciesList();
   final JpsModuleDependency dependency =
       dependenciesList.addModuleDependency(elementFactory.createModuleReference(moduleName));
   final JpsJavaDependencyExtension extension =
       getService().getOrCreateDependencyExtension(dependency);
   extension.setExported(exported);
 }
 @Override
 public void saveModuleDependencyProperties(JpsDependencyElement dependency, Element orderEntry) {
   JpsJavaDependencyExtension extension = getService().getDependencyExtension(dependency);
   if (extension != null) {
     if (extension.isExported()) {
       orderEntry.setAttribute(EXPORTED_ATTRIBUTE, "");
     }
     JpsJavaDependencyScope scope = extension.getScope();
     if (scope != JpsJavaDependencyScope.COMPILE) {
       orderEntry.setAttribute(SCOPE_ATTRIBUTE, scope.name());
     }
   }
 }
  @Override
  public void loadModuleDependencyProperties(JpsDependencyElement dependency, Element entry) {
    boolean exported = entry.getAttributeValue(EXPORTED_ATTRIBUTE) != null;
    String scopeName = entry.getAttributeValue(SCOPE_ATTRIBUTE);
    JpsJavaDependencyScope scope =
        scopeName != null
            ? JpsJavaDependencyScope.valueOf(scopeName)
            : JpsJavaDependencyScope.COMPILE;

    final JpsJavaDependencyExtension extension =
        getService().getOrCreateDependencyExtension(dependency);
    extension.setExported(exported);
    extension.setScope(scope);
  }
 private static void setLibraryEntryExported(
     final JpsDependencyElement dependency, boolean exported) {
   final JpsJavaDependencyExtension extension =
       getService().getOrCreateDependencyExtension(dependency);
   extension.setExported(exported);
 }