final ModuleStructureSpec rootDeploymentSpecification = result.getRootDeploymentSpecification();
if (rootDeploymentSpecification != null) {
final Map<VirtualFile, ResourceRoot> resourceRoots = resourceRoots(deploymentUnit);
moduleSpec.addUserDependencies(rootDeploymentSpecification.getModuleDependencies());
moduleSpec.addExclusions(rootDeploymentSpecification.getExclusions());
moduleSpec.addAliases(rootDeploymentSpecification.getAliases());
moduleSpec.addModuleSystemDependencies(rootDeploymentSpecification.getSytemDependencies());
for (final ResourceRoot additionalResourceRoot : rootDeploymentSpecification.getResourceRoots()) {
final ResourceRoot existingRoot = resourceRoots.get(additionalResourceRoot.getRoot());
if (existingRoot != null) {