def METHOD_NAME(
    self, *, version_in_target_name: bool = False, resolve: str | None = None
) -> str:
    targets = ""
    for requirement in self.requirements:
        maybe_version = f"_{requirement.coordinate.version}" if version_in_target_name else ""
        maybe_resolve = f'resolve="{resolve}",' if resolve else ""
        targets += textwrap.dedent(
            f"""\
        jvm_artifact(
          name="{requirement.coordinate.group}_{requirement.coordinate.artifact}{maybe_version}",
          group="{requirement.coordinate.group}",
          artifact="{requirement.coordinate.artifact}",
          version="{requirement.coordinate.version}",
          {maybe_resolve}
        )
        """
        )
    return targets