def __init__(self,
               name=None,
               address=None,
               payload=None,
               main=None,
               basename=None,
               source=None,
               deploy_excludes=None,
               deploy_jar_rules=None,
               manifest_entries=None,
               shading_rules=None,
               **kwargs):
    """
    :API: public

    :param string main: The name of the ``main`` class, e.g.,
      ``'org.pantsbuild.example.hello.main.HelloMain'``. This class may be
      present as the source of this target or depended-upon library.
    :param string basename: Base name for the generated ``.jar`` file, e.g.,
      ``'hello'``. (By default, uses ``name`` param)  Note this is unsafe
      because of the possible conflict when multiple binaries are built.
    :param string source: Name of one ``.java`` or ``.scala`` file (a good
      place for a ``main``).
    :param dependencies: Targets (probably ``java_library`` and
     ``scala_library`` targets) to "link" in.
    :type dependencies: list of target specs
    :param deploy_excludes: List of `exclude <#exclude>`_\s to apply
      at deploy time.
      If you, for example, deploy a java servlet that has one version of
      ``servlet.jar`` onto a Tomcat environment that provides another version,
      they might conflict. ``deploy_excludes`` gives you a way to build your
      code but exclude the conflicting ``jar`` when deploying.
    :param deploy_jar_rules: `Jar rules <#jar_rules>`_ for packaging this binary in a
      deploy jar.
    :param manifest_entries: dict that specifies entries for `ManifestEntries <#manifest_entries>`_
      for adding to MANIFEST.MF when packaging this binary.
    :param list shading_rules: Optional list of shading rules to apply when building a shaded
      (aka monolithic aka fat) binary jar. The order of the rules matters: the first rule which
      matches a fully-qualified class name is used to shade it. See shading_relocate(),
      shading_exclude(), shading_relocate_package(), and shading_exclude_package().
    """
    self.address = address  # Set in case a TargetDefinitionException is thrown early
    if main and not isinstance(main, string_types):
      raise TargetDefinitionException(self, 'main must be a fully qualified classname')
    if source and not isinstance(source, string_types):
      raise TargetDefinitionException(self, 'source must be a single relative file path')
    if deploy_jar_rules and not isinstance(deploy_jar_rules, JarRules):
      raise TargetDefinitionException(self,
                                      'deploy_jar_rules must be a JarRules specification. got {}'
                                      .format(type(deploy_jar_rules).__name__))
    if manifest_entries and not isinstance(manifest_entries, dict):
      raise TargetDefinitionException(self,
                                      'manifest_entries must be a dict. got {}'
                                      .format(type(manifest_entries).__name__))
    sources = [source] if source else None
    if 'sources' in kwargs:
      raise self.IllegalArgument(address.spec,
        'jvm_binary only supports a single "source" argument, typically used to specify a main '
        'class source file. Other sources should instead be placed in a java_library, which '
        'should be referenced in the jvm_binary\'s dependencies.'
      )
    payload = payload or Payload()
    payload.add_fields({
      'basename': PrimitiveField(basename or name),
      'deploy_excludes': ExcludesField(self.assert_list(deploy_excludes,
                                                        expected_type=Exclude,
                                                        key_arg='deploy_excludes')),
      'deploy_jar_rules': FingerprintedField(deploy_jar_rules or JarRules.default()),
      'manifest_entries': FingerprintedField(ManifestEntries(manifest_entries)),
      'main': PrimitiveField(main),
      'shading_rules': PrimitiveField(shading_rules or ()),
    })

    super(JvmBinary, self).__init__(name=name,
                                    address=address,
                                    payload=payload,
                                    sources=self.assert_list(sources, key_arg='sources'),
                                    **kwargs)
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/jvm/targets/jvm_binary.py/JvmBinary.__init__/original