class KPM::BaseArtifact
def artifact_info(logger, coordinate_map, sha1_file = nil, force_download = false, overrides = {}, ssl_verify = true)
def artifact_info(logger, coordinate_map, sha1_file = nil, force_download = false, overrides = {}, ssl_verify = true) info = { skipped: false } sha1_checker = sha1_file ? Sha1Checker.from_file(sha1_file) : nil coordinates = KPM::Coordinates.build_coordinates(coordinate_map) begin nexus_info = nexus_remote(overrides, ssl_verify, logger).get_artifact_info(coordinates) rescue KPM::NexusFacade::ArtifactMalformedException => e raise StandardError, "Invalid coordinates #{coordinate_map}: #{e}" rescue StandardError => e logger.warn("Unable to retrieve coordinates #{coordinate_map}: #{e}") cached_coordinates = sha1_checker ? sha1_checker.artifact_info(coordinates) : nil raise e if force_download || !cached_coordinates # Use the cache return cached_coordinates end xml = REXML::Document.new(nexus_info) info[:sha1] = xml.elements['//sha1'].text unless xml.elements['//sha1'].nil? info[:version] = xml.elements['//version'].text unless xml.elements['//version'].nil? info[:repository_path] = xml.elements['//repositoryPath'].text unless xml.elements['//repositoryPath'].nil? info[:is_tgz] = info[:repository_path].end_with?('.tar.gz') || info[:repository_path].end_with?('.tgz') sha1_checker.cache_artifact_info(coordinates, info) if sha1_checker info end