Class SnapshotMetadataHealer
maven-metadata.xml whose checksum
sidecars no longer match it, so the next deploy can proceed
(IKE-Network/ike-issues#1160).
Nexus rebuilds metadata in the background after a deploy and can
rewrite a version's maven-metadata.xml without writing a matching
.sha1 (IKE-Network/ike-issues#1107). The next deploy of that
version downloads the pair, fails checksum validation, and stops; nothing
on the client side repairs it. Deleting the metadata and its sidecars lets
that deploy write them fresh, because the metadata is derived from the
version's files and carries nothing of its own.
The healer touches only <group>/<artifact>/<version>/maven-metadata.xml
and its .sha1, .md5, .sha256 and .sha512
sidecars, only for a -SNAPSHOT version, and only when a sidecar
that is present disagrees with the XML. Artifacts and release versions
are never touched. A repository that cannot be read is reported and left
to the deploy, which reports the underlying problem itself.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCredentials for the repository, as Maven's settings give them for the deploy target's server id.static enumWhat the healer found and did for one version.static final recordThe result for one version. -
Constructor Summary
ConstructorsConstructorDescriptionSnapshotMetadataHealer(HttpClient client, Duration timeout) Creates a healer. -
Method Summary
-
Constructor Details
-
SnapshotMetadataHealer
Creates a healer.- Parameters:
client- the HTTP client to reach the repository withtimeout- the timeout for each request
-
-
Method Details
-
heal
public SnapshotMetadataHealer.Result heal(URI repository, Optional<SnapshotMetadataHealer.Credentials> credentials, String groupId, String artifactId, String version) Checks one version's metadata and repairs it when a checksum sidecar disagrees with it.- Parameters:
repository- the deploy repository's base URLcredentials- the repository credentials, or empty to send nonegroupId- the artifact's group idartifactId- the artifact idversion- the version being deployed- Returns:
- what was found and done
-