code: def jar_versioner(program_name, jar_name):
      
      def get_version(config):
          try:
              pdir = config_utils.get_program(program_name, config, "dir")
          # not configured
          except ValueError:
              return ""
          jar = os.path.basename(config_utils.get_jar(jar_name, pdir))
          for to_remove in [jar_name, ".jar", "-standalone"]:
              jar = jar.replace(to_remove, "")
          if jar.startswith(("-", ".")):
              jar = jar[1:]
          if not jar:
              logger.warn("Unable to determine version for program '{}' from jar file {}".format(
                  program_name, config_utils.get_jar(jar_name, pdir)))
          return jar
      return get_version
docs: Retrieve version information based on jar file.