def tool_jar_from_products(cls, products, key, scope):
    """Get the jar for the tool previously registered under key in the given scope.

    :param products: The products of the current pants run.
    :type products: :class:`pants.goal.products.Products`
    :param string key: The key the tool configuration was registered under.
    :param string scope: The scope the tool configuration was registered under.
    :returns: A single jar path.
    :rtype: string
    :raises: `JvmToolMixin.InvalidToolClasspath` when the tool classpath is not composed of exactly
             one jar.
    """
    classpath = cls.tool_classpath_from_products(products, key, scope)
    if len(classpath) != 1:
      params = dict(tool=key, scope=scope, count=len(classpath), classpath='\n\t'.join(classpath))
      raise cls.InvalidToolClasspath('Expected tool {tool} in scope {scope} to resolve to one '
                                     'jar, instead found {count}:\n\t{classpath}'.format(**params))
    return classpath[0]
Get the jar for the tool previously registered under key in the given scope.

    :param products: The products of the current pants run.
    :type products: :class:`pants.goal.products.Products`
    :param string key: The key the tool configuration was registered under.
    :param string scope: The scope the tool configuration was registered under.
    :returns: A single jar path.
    :rtype: string
    :raises: `JvmToolMixin.InvalidToolClasspath` when the tool classpath is not composed of exactly
             one jar.