code: def add_jars_for_targets(self, targets, conf, resolved_jars):
      
      classpath_entries = []
      for jar in resolved_jars:
        if not jar.pants_path:
          raise TaskError('Jar: {!s} has no specified path.'.format(jar.coordinate))
        cp_entry = ArtifactClasspathEntry(jar.pants_path, jar.coordinate, jar.cache_path, jar.directory_digest)
        classpath_entries.append((conf, cp_entry))
  
      for target in targets:
        self._add_elements_for_target(target, classpath_entries)
docs: Adds jar classpath elements to the products of the provided targets.
  
      The resolved jars are added in a way that works with excludes.
      :param targets: The targets to add the jars for.
      :param conf: The configuration.
      :param resolved_jars: A list of ResolvedJars.