archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Erdfelt <>
Subject MRM-463 - metadata handling / merging
Date Wed, 15 Aug 2007 00:14:23 GMT
MRM-463 has a bunch of unanswered questions for me.

[ link for the lazy to use ]

.\ Synopsis \.

We have to maintain a sane metadata.xml for the m2 clients.

.\ Details \.

There are 2 major kinds of metadata.xml from what I can see.

.\ Metadata Type 1: [ groupId:artifactId ] \.

One that is obtained at the groupId:artifactId level, and contains a set 
of available versions for a specific artifactId.  With a link to the 
'current' or 'latest' version.

Example 1:


This example is actually bad IMO, as the top level version 
/metadata/version element isn't the latest version, or the current 
version, or even the last uploaded version.

.\ Metadata Type 2: [ groupId:artifactId:version ] \.

This type is version specific.

So far, most released artifacts have this in their directory, but it is 
not terribly useful IMO.

Example 2:


Not very exciting, quite easy actually.

But when we deal with snapshots, it becomes critical.

First we'll look at an artifact with Timestamped snapshots.
Example 3:

<?xml version="1.0" encoding="UTF-8"?>

Next, here is an example without Timestamped snapshots.
Example 4:

<?xml version="1.0" encoding="UTF-8"?>

Next, here is an example of an artifact with Timestamped and non 
Timestamped artifacts.  To see this you'll need to browse the directory:

(course, this is appears to be a case of someone uploading their local 

Example 5:

<?xml version="1.0" encoding="UTF-8"?>

.\ Areas of Concern \.

Alright, I think we have few areas of focus around this.

1) The repository consumer run to ensure that a metadata.xml file exists.
2) The database consumer run to ensure that the contents of the metadata.xml
   are sane based on the list of available versions in the database.
3) When proxying content from a remote repository for a released artifact,
   the type 1 groupId:artifactId needs to be updated to reflect the new
   artifactId:version that was just downloaded.
4) When proxying content from a remote repository for a snapshot artifact,
   the proxy mechanism needs to pull the remote metadata.xml to determine
   what actual artifactId:version to pull.  Is it timestamped or not?
5) When proxying content from a remote repository for a snapshot artifact,
   the managed repository needs to have the current metadata.xml for
   remote repository?
6) When presenting to the user browsing the repository, do we show what is
   in the managed repository, or the full list of potential versions 
from all
   downstream remote repositories too?

.\ Ideas \.

I think it would be a good idea to adopt what happens in the local 
now, and have maven-metadata-${remote_repo_id}.xml files in the managed
repository that the proxy mechanism keeps up to date, and the seperate merge
mechanism utilizes to keep the managed repository metadata.xml as accurate
as possible with all potential versions available.


- Joakim Erdfelt

View raw message