<commit_before>package com.jatescher

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging.autoImport.bashScriptExtraDefines
import sbt._
import sbt.Keys._

object Jolokia extends AutoPlugin {

  object autoImport {
    val jolokiaAgent = taskKey[File]("Jolokia agent jar location")
    val jolokiaVersion = settingKey[String]("Jolokia version")
    val jolokiaPort = settingKey[String]("Jolokia port")
    val jolokiaHost = settingKey[String]("Jolokia host")
  }

  import autoImport._

  override def requires = JavaAppPackaging

  val jolokiaConfig = config("jolokia-jvm").hide

  override lazy val projectSettings = Seq(
    ivyConfigurations += jolokiaConfig,
    jolokiaAgent := findJolokiaAgent(update.value),
    jolokiaVersion := "1.3.2",
    jolokiaPort := "8778",
    jolokiaHost := "0.0.0.0",
    libraryDependencies += "org.jolokia" % "jolokia-jvm" % jolokiaVersion.value % jolokiaConfig,
    mappings in Universal ++= Seq(
      jolokiaAgent.value -> "jolokia/jolokia.jar"
    ),
    bashScriptExtraDefines += """addJava "-javaagent:${app_home}/../jolokia/jolokia.jar=port=${jolokiaPort},host=${jolokiaHost}""""
  )

  private[this] val jolokiaFilter: DependencyFilter = configurationFilter("jolokia-jvm") && artifactFilter(`type` = "jar")

  def findJolokiaAgent(report: UpdateReport) = report.matching(jolokiaFilter).head

}
<commit_msg>Add ENV variable configuration for host and port<commit_after>package com.jatescher

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging.autoImport.bashScriptExtraDefines
import sbt._
import sbt.Keys._

object Jolokia extends AutoPlugin {

  object autoImport {
    val jolokiaAgent = taskKey[File]("Jolokia agent jar location")
    val jolokiaVersion = settingKey[String]("Jolokia version")
    val jolokiaPort = settingKey[String]("Jolokia port")
    val jolokiaHost = settingKey[String]("Jolokia host")
  }

  import autoImport._

  override def requires = JavaAppPackaging

  val jolokiaConfig = config("jolokia-jvm").hide

  override lazy val projectSettings = Seq(
    ivyConfigurations += jolokiaConfig,
    jolokiaAgent := findJolokiaAgent(update.value),
    jolokiaVersion := "1.3.2",
    jolokiaPort := "8778",
    jolokiaHost := "0.0.0.0",
    libraryDependencies += "org.jolokia" % "jolokia-jvm" % jolokiaVersion.value % jolokiaConfig classifier "agent",
    mappings in Universal ++= Seq(
      jolokiaAgent.value -> "jolokia/jolokia.jar"
    ),
    bashScriptExtraDefines += s"JOLOKIA_PORT=${jolokiaPort.value}",
    bashScriptExtraDefines += s"JOLOKIA_HOST=${jolokiaHost.value}",
    bashScriptExtraDefines += """addJava "-javaagent:${app_home}/../jolokia/jolokia.jar=port=${JOLOKIA_PORT},host=${JOLOKIA_HOST}""""
  )

  private[this] val jolokiaFilter: DependencyFilter = configurationFilter("jolokia-jvm") && artifactFilter(`type` = "jar", classifier = "agent")

  def findJolokiaAgent(report: UpdateReport) = report.matching(jolokiaFilter).head

}

{'fraction_non_alphanumeric': 0.12205975842339478, 'fraction_numerical': 0.006993006993006993, 'mean_word_length': 5.040307101727447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '965947', 'n_tokens_mistral': 1151, 'n_tokens_neox': 1046, 'n_words': 185}