private void resolveImports(ModuleManager moduleManager) {

    autoImportModules(moduleManager);

    for (Import importEntry : this.imports) {

      ModuleDefinition dependencyModule = null;

      if (moduleManager != null) {
        dependencyModule = moduleManager.getModule(importEntry.getName());
      }

      if (dependencyModule == null) {
        throw new KurentoModuleCreatorException(
            "Import '" + importEntry.getName() + "' not found in dependencies in any version");
      } else {

        if (!VersionManager.compatibleVersion(importEntry.getVersion(),
            dependencyModule.getVersion())) {

          if (VersionManager.devCompatibleVersion(importEntry.getVersion(),
              dependencyModule.getVersion())) {

            log.info("[WARNING] Dependency on module '" + importEntry.getName() + "' version '"
                + importEntry.getVersion() + "' is satisfied with version '"
                + dependencyModule.getVersion() + "'");
          } else {

            throw new KurentoModuleCreatorException("Import '" + importEntry.getName()
                + "' with version " + importEntry.getVersion()
                + " not found in dependencies, found version: " + dependencyModule.getVersion());
          }
        }
      }

      dependencyModule.resolveModule(moduleManager);
      importEntry.setModule(dependencyModule);

      if (importEntry.getMavenVersion() == null) {
        importEntry.setMavenVersion(VersionManager.convertToMavenImport(importEntry.getVersion()));
      }

      if (importEntry.getNpmVersion() == null) {
        importEntry.setNpmVersion(VersionManager.convertToNpmImport(
            dependencyModule.getCode().getApi().get("js").get("npmGit"), importEntry.getVersion()));
      }
    }
  }