code: public Map<String, List<String>> buildDepsForAllComponents() {
  
          Map<String, List<String>> ret = new HashMap<String, List<String>>();
  
          Iterator<CmsSetupComponent> itComponents = CmsCollectionsGenericWrapper.<CmsSetupComponent> list(
              m_components.elementList()).iterator();
          while (itComponents.hasNext()) {
              CmsSetupComponent component = itComponents.next();
  
              // if component a depends on component b, and component c depends also on component b:
              // build a map with a list containing "a" and "c" keyed by "b" to get a
              // list of components depending on component "b"...
              Iterator<String> itDeps = component.getDependencies().iterator();
              while (itDeps.hasNext()) {
                  String dependency = itDeps.next();
  
                  // get the list of dependent modules
                  List<String> componentDependencies = ret.get(dependency);
                  if (componentDependencies == null) {
                      // build a new list if "b" has no dependent modules yet
                      componentDependencies = new ArrayList<String>();
                      ret.put(dependency, componentDependencies);
                  }
                  // add "a" as a module depending on "b"
                  componentDependencies.add(component.getId());
              }
          }
          itComponents = CmsCollectionsGenericWrapper.<CmsSetupComponent> list(m_components.elementList()).iterator();
          while (itComponents.hasNext()) {
              CmsSetupComponent component = itComponents.next();
              if (ret.get(component.getId()) == null) {
                  ret.put(component.getId(), new ArrayList<String>());
              }
          }
          return ret;
      }
docs: Returns a map of dependencies.<p>
  
  The component dependencies are get from the setup and module components.properties files found.<p>
  
  @return a Map of component ids as keys and a list of dependency names as values