Class CpeArtifactsEncoder
cpe-artifacts platform property.
The property records, for each supported runtime extension artifact of a platform member, the set of
artifacts that a consumer (a Quarkus build step) should attribute to that member's CPE. The data is a
map keyed by the runtime extension artifact, so a consumer can look up the runtime artifacts
flagged in the ApplicationModel directly, without having to map them to their deployment
counterparts itself. The value of each entry is the extension's deployment artifact followed by the
artifacts of its resolved deployment dependency closure (aligned to the versions the platform ships).
Serialized format
The same coordinates recur heavily across entries (deployment closures overlap between extensions), and even distinct coordinates share groupIds, versions and artifactId prefixes. The map is serialized in two sections separated by a "--" line:- a dictionary of every distinct coordinate, grouped so shared parts are written once;
- the entries: one line per runtime extension as
<runtime-index>[<delta>,<delta>,...], where the runtime index and the (delta-encoded) dependency indices are base-36 references into the dictionary.
Dictionary section
Coordinates are grouped by groupId; within a groupId they are grouped by version. Each line is self-identifying by its first character:@groupId— starts a group; the very next line is that group's common artifactId prefix (possibly empty), applied to every artifact line in the group;=version— starts a version sub-block within the current group;- anything else — an artifact line: the artifactId with the group prefix stripped, optionally
followed by
:classifierand/or:type. Trailing defaults (empty classifier,jartype) are omitted, so a plain artifactId means an empty-classifierjar. An empty line means the artifactId equals the group prefix exactly.
@/prefix/=
lines consume no index. The prefix line is positional (always present immediately after @groupId),
so no sentinel character is needed for it and empty lines are unambiguously artifact lines.
Removing the long-range repetition this way (which deflate's 32 KB window cannot reach) and delta-encoding the ascending dependency indices shrinks a real platform member's encoded value by roughly a fifth beyond a naive dictionary.
The output is deterministic and therefore reproducible: the dictionary is sorted by (groupId, version, artifactId, classifier, type), so index assignment depends only on content (not on the input map's iteration order); entries are ordered by their runtime key's dictionary index; and dependency indices are emitted in ascending order. The serialized text is then deflate-compressed and Base64-encoded to keep the property value compact. Byte-identical output across builds additionally assumes a consistent JDK/zlib (the release toolchain), as with any deflate-based artifact.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<ArtifactCoords, List<ArtifactCoords>> static Stringencode(Map<ArtifactCoords, List<ArtifactCoords>> deploymentDeps)
-
Method Details
-
encode
-
decode
-