Krikri::PluginHelpers::MavenArtifactCommand
MavenArtifactCommand - the pure logic of community.general.maven_artifact, split out of the plugin so the repo-path arithmetic, the generated filenames, the maven-metadata.xml parsing (latest version, snapshot resolution) and the checksum comparison are unit-testable without a Maven repository. The plugin executes the HTTP/file transfers.
Constants
Artifact#path: group_id with dots -> slashes, then artifact_id, then the version directory - except timestamped snapshot versions ("1.2.3-20240101.123456-7" or "x-1.2.3-..."), whose directory keeps the "SNAPSHOT" spelling (real module's timestamp_version_match rewrite).
Class methods
is_invalid_checksum: the remote checksum file may carry a trailing filename; only the first token compares, case insensitively.
Artifact#_generate_filename / get_filename: when dest is a directory, the artifact lands under its generated name; keep_name keeps the version part of it.
The timestamp/buildNumber fallback, given the base version string ("1.2.3-SNAPSHOT") and the metadata contents.
Snapshot resolution for find_uri_for_artifact: prefer the snapshotVersions entry matching classifier+extension, else the timestamp/buildNumber fallback (version.replace("SNAPSHOT", "TIMESTAMP-BUILDNUM")).