Skip to end of metadata
Go to start of metadata

Descriptors

Maven update manager uses 3 different XML documents for it's operations

Version List or VL - stores information about all available versions. In case of Maven install - it describes all available Maven *CD*s

Configuration Descriptor or CD - describes one particular version configuration. MP3 updater uses it for a list of dependency GAVs, that are used to calculate a full transitive closure for a given installation

Release is simple, just one entry point calculates into a full transitive closure

For a snapshot - descriptor becomes a little more dense: because all snapshot dependencies of a timestamped snapshot are listed in the POM as -SNAPSHOT, they would resolve into a the latest timestamp and mess the closuer. To overcome this obstacle, you need to list all the timestaped dependencies in the CD, so that they win in the dependency resolution. Example of such a descriptor - below. MP3 also provides tool to help you calculate this list - see below.

Lock Down List or LDL - expanded list of all the binaries in a version, used to capture calculated transitive closure. You will need to create one for your distribution. MP3 Updater needs it to get a list of all the binaries in the newly distributed version of Maven.

How to add a version

From the description of the XML documents, it more or less clear how to add a new version to the list of available versions:

  • add it to the list of available versions in the Version List, found at org.apache.maven:maven-versions:1.0::ver
  • each version there points to a a GAV of a CD of that version, for example org.apache.maven:maven-cd:3.0-alpha-1, the type of this artifact should be cd, but you don't have to specify it - MP3 will do it for you.
  • deploy CD to a repository and you are good to go.

MP3 tools to help creating descriptors

mvnUpdate -c GAV REGEX VERSION_FROM VERSION_TO -n, where

  • GAV - GAV of the entry point artifact to create a closure for
  • REGEX - regEx of a artifactId to match
  • VERSION_FROM VERSION_TO - in the matched artifacts, if the have version VERSION_FROM, replace it with VERSION_TO, add this artifact to the list, and resolve again, untill no more matches are found.
  • -n At the end, this CLI will try to resolve the binaries and fails if some of them are not found. Use this flag to turn off this download test.

For example

mvnUpdate -c org.apache.maven:maven-core:3.0-20090128.172840-19 maven-. 3.0-SNAPSHOT 3.0-20090128.172840-19* will iterate over the list of dependencies of org.apache.maven:maven-core:3.0-20090128.172840-19, and if there are artifacts matching maven-.*, replace version 3.0-SNAPSHOT to 3.0-20090128.172840-19, add to the list and try again.

New Maven distro

apache-maven project has a new folder: src/.cd, it contains 3 files descriptors. We'll be able to generate them later on, but now it is a manual operation.

If the current version is VERSION, these files are:

  • apache-maven.cd and apache-maven-VERSION.cd two identical files that describe the current version
  • apache-maven-VERSION.ldl the full lock down list for this version

These 3 files are included into distribution and are used to by the MP3 to correctly update this version.

  • No labels