<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_jvm_tool(cls, register, key, classpath_spec=None, main=None, custom_rules=None, fingerprint=True, classpath=None, help=None, removal_version=None, removal_hint=None):
 """Registers a jvm tool under `key` for lazy classpath resolution. Classpaths can be retrieved in `execute` scope via `tool_classpath_from_products`. NB: If the tool's `main` class name is supplied the tool classpath will be shaded. :param register: A function that can register options with the option system. :param unicode key: The key the tool configuration should be registered under. :param unicode classpath_spec: The tool classpath target address spec that can be used to override this tool's classpath; by default, `//:[key]`. :param unicode main: The fully qualified class name of the tool's main class if shading of the tool classpath is desired. :param list custom_rules: An optional list of `Shader.Rule`s to apply before the automatically generated binary jar shading rules. This is useful for excluding classes shared between the tool and the code it runs over. The canonical example is the `org.junit.Test` annotation read by junit runner tools from user code. In this sort of case the shared code must have a uniform name between the tool and the user code and so the shared code must be excluded from shading. :param bool fingerprint: Indicates whether to include the jvm tool in the task's fingerprint. Note that unlike for other options, fingerprinting is enabled for tools by default. :param list classpath: A list of one or more `JarDependency` objects that form this tool's default classpath. If the classpath is optional, supply an empty list; otherwise the default classpath of `None` indicates the `classpath_spec` must point to a target defined in a BUILD file that provides the tool classpath. :param unicode help: An optional custom help string; otherwise a reasonable one is generated. :param string removal_version: A semver at which this tool will be removed. :param unicode removal_hint: A hint on how to migrate away from this tool. """

    def formulate_help():
      if classpath:
        return ('Target address spec for overriding the classpath of the {} jvm tool which is, '
                'by default: {}'.format(key, classpath))
      else:
        return 'Target address spec for specifying the classpath of the {} jvm tool.'.format(key)
    help = help or formulate_help()

    register('--{}'.format(key),
             advanced=True,
             type=target_option,
             default='//:{}'.format(key) if classpath_spec is None else classpath_spec,
             help=help,
             fingerprint=fingerprint,
             removal_version=removal_version,
             removal_hint=removal_hint)

    # TODO(John Sirois): Move towards requiring tool specs point to jvm_binary targets.
    # These already have a main and are a natural place to house any custom shading rules.  That
    # would eliminate the need to pass main and custom_rules here.
    # It is awkward that jars can no longer be inlined as dependencies - this will require 2 targets
    # for every tool - the jvm_binary, and a jar_library for its dependencies to point to.  It may
    # be worth creating a JarLibrary subclass - say JarBinary, or else mixing in a Binary interface
    # to JarLibrary to endow it with main and shade_rules attributes to allow for single-target
    # definition of resolvable jvm binaries.
    jvm_tool = cls.JvmTool(register.scope, key, classpath, main, custom_rules)
    JvmToolMixin._jvm_tools.append(jvm_tool)