mavenrepo.py
def _fetchTreeDeps (self, coord, scope, downloadedItems, exclusions):
    """ Downloads given coordinate and its dependencies recursively for given
    scope. All downloaded dependencies will be added to downloadedItems to avoid
    recursion.

    For quick lookups exclusions is mapping the coord.name with the actual
    coord excluded.
    """
    # is maven object in cache downloadedItems ['<group:artifact>']
    if coord.name in downloadedItems:
      if (downloadedItems [coord.name].coord.id != coord.id):
        if mavenvercmp.compare (
          downloadedItems [coord.name].coord.id,
          coord.id
        ) < 0:
          # TODO: adjust versions versions
          print "WARNING: expecting same coord id for package '%s' vs '%s'" % (coord.id, downloadedItems [coord.name].coord.id)
      return downloadedItems [coord.name]

    maven = self.fetchWithAncestors (coord)
    if not maven:
      return None

    maven.resolve (jdkVersion = self._jdkVersion)

    # TODO: handle provided

    children = {}
    for dep in maven.deps.getFlattenDeps(skipOptional = True):
      if (dep.coord.scope != scope):
        continue

      if dep.coord.name in exclusions:
        if dep.coord.isContained (exclusions [dep.coord.name]):
          # exclude dep
          continue

      # build the new exclusion list based on current dep
      newExclusions = exclusions.copy()
      for exclusion in dep.exclusions:
        newExclusions[exclusion.name] = exclusion

      # fetch child with deps
      mavenChild = self._fetchTreeDeps (
        dep.coord,
        scope,
        downloadedItems,
        newExclusions
      )
      if mavenChild:
        mavenChild.resolve (jdkVersion = self._jdkVersion)
        children [dep.coord.id] = mavenChild

    # update dependencies of this element
    for dep in maven.deps.root.deps:
      if dep.coord.id not in children:
        continue

      # assert dep.coord.id == mavenChild.deps.root.coord.id
      childDepsClone = children[dep.coord.id].deps.clone()
      dep.deps += childDepsClone.root.deps
      dep.exclusions += childDepsClone.root.exclusions

    downloadedItems [coord.name] = maven

    maven.resolve (scope = scope, jdkVersion = self._jdkVersion)
    return maven
 Downloads given coordinate and its dependencies recursively for given
    scope. All downloaded dependencies will be added to downloadedItems to avoid
    recursion.

    For quick lookups exclusions is mapping the coord.name with the actual
    coord excluded.
    
Downloads given coordinate and its dependencies recursively for given
scope. All downloaded dependencies will be added to downloadedItems to avoid
recursion.

For quick lookups exclusions is mapping the coord.name with the actual
coord excluded.
Downloads given coordinate and its dependencies recursively for given scope . All downloaded dependencies will be added to downloadedItems to avoid recursion . For quick lookups exclusions is mapping the coord . name with the actual coord excluded .
def _fetchTreeDeps (self, coord, scope, downloadedItems, exclusions):
    if coord.name in downloadedItems:
      if (downloadedItems [coord.name].coord.id != coord.id):
        if mavenvercmp.compare (
          downloadedItems [coord.name].coord.id,
          coord.id
        ) < 0:
          print "WARNING: expecting same coord id for package '%s' vs '%s'" % (coord.id, downloadedItems [coord.name].coord.id)
      return downloadedItems [coord.name]
    maven = self.fetchWithAncestors (coord)
    if not maven:
      return None
    maven.resolve (jdkVersion = self._jdkVersion)
    children = {}
    for dep in maven.deps.getFlattenDeps(skipOptional = True):
      if (dep.coord.scope != scope):
        continue
      if dep.coord.name in exclusions:
        if dep.coord.isContained (exclusions [dep.coord.name]):
          continue
      newExclusions = exclusions.copy()
      for exclusion in dep.exclusions:
        newExclusions[exclusion.name] = exclusion
      mavenChild = self._fetchTreeDeps (
        dep.coord,
        scope,
        downloadedItems,
        newExclusions
      )
      if mavenChild:
        mavenChild.resolve (jdkVersion = self._jdkVersion)
        children [dep.coord.id] = mavenChild
    for dep in maven.deps.root.deps:
      if dep.coord.id not in children:
        continue
      childDepsClone = children[dep.coord.id].deps.clone()
      dep.deps += childDepsClone.root.deps
      dep.exclusions += childDepsClone.root.exclusions
    downloadedItems [coord.name] = maven
    maven.resolve (scope = scope, jdkVersion = self._jdkVersion)
    return maven
def _fetchTreeDeps ( self , coord , scope , downloadedItems , exclusions ) : if coord . name in downloadedItems : if ( downloadedItems [ coord . name ] . coord . id != coord . id ) : if mavenvercmp . compare ( downloadedItems [ coord . name ] . coord . id , coord . id ) < 0 : print "WARNING: expecting same coord id for package '%s' vs '%s'" % ( coord . id , downloadedItems [ coord . name ] . coord . id ) return downloadedItems [ coord . name ] maven = self . fetchWithAncestors ( coord ) if not maven : return None maven . resolve ( jdkVersion = self . _jdkVersion ) children = { } for dep in maven . deps . getFlattenDeps ( skipOptional = True ) : if ( dep . coord . scope != scope ) : continue if dep . coord . name in exclusions : if dep . coord . isContained ( exclusions [ dep . coord . name ] ) : continue newExclusions = exclusions . copy ( ) for exclusion in dep . exclusions : newExclusions [ exclusion . name ] = exclusion mavenChild = self . _fetchTreeDeps ( dep . coord , scope , downloadedItems , newExclusions ) if mavenChild : mavenChild . resolve ( jdkVersion = self . _jdkVersion ) children [ dep . coord . id ] = mavenChild for dep in maven . deps . root . deps : if dep . coord . id not in children : continue childDepsClone = children [ dep . coord . id ] . deps . clone ( ) dep . deps += childDepsClone . root . deps dep . exclusions += childDepsClone . root . exclusions downloadedItems [ coord . name ] = maven maven . resolve ( scope = scope , jdkVersion = self . _jdkVersion ) return maven
Downloads given coordinate and its dependencies recursively for given
scope.
Downloads given coordinate and its dependencies recursively for given scope .
""" Downloads given coordinate and its dependencies recursively for given
    scope. All downloaded dependencies will be added to downloadedItems to avoid
    recursion.

    For quick lookups exclusions is mapping the coord.name with the actual
    coord excluded.
    """ # is maven object in cache downloadedItems ['<group:artifact>'] # TODO: adjust versions versions # TODO: handle provided # exclude dep # build the new exclusion list based on current dep # fetch child with deps # update dependencies of this element # assert dep.coord.id == mavenChild.deps.root.coord.id
self
coord
scope
downloadedItems
exclusions