I've come up with a simple maven plugin that adds
the subversion revision to the manifest. So with


    public static Map getJarRevisions() throws IOException {
final String[] jars = System.getProperty ("java.class.path").split(
                System.getProperty("path.separator"));
        final Map revisions = new HashMap(jars.length);
        for (int i = 0; i < jars.length; i++) {
            final JarFile jar = new JarFile(jars[i]);
            final Manifest manifest = jar.getManifest();
final String revision = (String) manifest.getMainAttributes().getValue("Revision");
            revisions.put(jars[i], revision);
        }

      return revisions;
    }

You know *exactly* what jars are in your path.
Only add it to your maven.xml like this:

  <postGoal name="jar:jar">
    <attainGoal name="revision:add"/>
  </postGoal>

It is currently available at:

 http://people.apache.org/~tcurdt/maven-revision-plugin.tgz

It's for maven1 but just wraps a simple class
so a version for maven2 should be pretty straight
forward.

If people think this is useful I am sure we can
improve it and put it somewhere properly.

cheers
--
Torsten

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to