The repositories section represents a slightly more exotic feature
in the assembly descriptor, since few applications other than Maven can
take full advantage of a Maven-repository directory structure. For this
reason, and because many of its features closely resemble those in the
dependencySets
section, we won’t spend too much time
on the repositories section of the assembly descriptor. In most cases,
users who understand dependency sets should have no trouble constructing
repositories via the Assembly plugin. We're not going to motivate the
repositories
section; we're not going to go through a
the business of setting up a use case and walking you through the
process. We're just going to bring up a few caveats for those of you who
find the need to use the repostiories
section.
Having said that, there are a two features particular to the
repositories section that deserve some mention. The first is the
includeMetadata
flag. When set to
true
it includes metadata such as the list of real
versions that correspond to -SNAPSHOT
virtual
versions, and by default it’s set to false
. At
present, the only metadata included when this flag is
true
is the information downloaded from Maven’s
central repository.
The second feature is called
groupVersionAlignments
. Again, this section is a list
of individual groupVersionAlignment
configurations,
whose purpose is to normalize all included artifacts for a particular
groupId
to use a single version
.
Each alignment entry consists of two mandatory elements -
id
and version
- along with an
optional section called excludes
that supplies a list
of artifactId
string values which are to be excluded
from this realignment. Unfortunately, this realignment doesn’t seem to
modify the POMs involved in the repository, neither
those related to realigned artifacts nor those that depend on realigned
artifacts, so it’s difficult to imagine what the practical application
for this sort of realignment would be.
In general, it’s simplest to apply the same principles you would use in dependency sets to repositories when adding them to your assembly descriptor. While the repositories section does support the above extra options, they are mainly provided for backward compatibility, and will probably be deprecated in future releases.