<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_resolve(cls, executor, extra_args, ivyxml, jvm_options, workdir_report_paths_by_conf, confs, ivy_resolution_cache_dir, ivy_cache_classpath_filename, resolve_hash_name, workunit_factory, workunit_name):
 """Execute Ivy with the given ivy.xml and copies all relevant files into the workdir. This method does an Ivy resolve, which may be either a Pants resolve or a Pants fetch depending on whether there is an existing frozen resolution. After it is run, the Ivy reports are copied into the workdir at the paths specified by workdir_report_paths_by_conf along with a file containing a list of all the requested artifacts and their transitive dependencies. :param executor: A JVM executor to use to invoke ivy. :param extra_args: Extra arguments to pass to ivy. :param ivyxml: The input ivy.xml containing the dependencies to resolve. :param jvm_options: A list of jvm option strings to use for the ivy invoke, or None. :param workdir_report_paths_by_conf: A dict mapping confs to report paths in the workdir. :param confs: The confs used in the resolve. :param resolve_hash_name: The hash to use as the module name for finding the ivy report file. :param workunit_factory: A workunit factory for the ivy invoke, or None. :param workunit_name: A workunit name for the ivy invoke, or None. """

    ivy = Bootstrapper.default_ivy(bootstrap_workunit_factory=workunit_factory)

    with safe_concurrent_creation(ivy_cache_classpath_filename) as raw_target_classpath_file_tmp:
      extra_args = extra_args or []
      args = ['-cachepath', raw_target_classpath_file_tmp] + extra_args

      with cls._ivy_lock:
        cls._exec_ivy(ivy, confs, ivyxml, args,
                      jvm_options=jvm_options,
                      executor=executor,
                      workunit_name=workunit_name,
                      workunit_factory=workunit_factory)

      if not os.path.exists(raw_target_classpath_file_tmp):
        raise cls.IvyError('Ivy failed to create classpath file at {}'
                           .format(raw_target_classpath_file_tmp))

      cls._copy_ivy_reports(workdir_report_paths_by_conf, confs, ivy_resolution_cache_dir, resolve_hash_name)

    logger.debug('Moved ivy classfile file to {dest}'
                 .format(dest=ivy_cache_classpath_filename))