On Sat, 2006-02-11 at 12:40 -0700, Julian Wood wrote: > Funny - I made one of these just a couple of days ago, and was going > to ask the same question, with regards to interest. > > > A few things I noticed along the way: the rev property from svn info > is local. You can commit files to the repository and the rev stays the > same (locally) until you update. So I made the plugin check to see if > you have locally modified files, and unless you suppress the behaviour > with -Dmaven.buildnumber.skipcheck=true, it will fail, saying you need > to deal with your changes. The second thing it does, again unless > suppressed, is update your working copy. This way you get the proper > revision number. > > > So I don't know if that was the best way to approach that part, or if > I missed anything in my logic up there, but it's working nicely now. > Obviously it only works for svn at the moment. I just wanted to have a > unique build number for every 1.0-SNAPSHOT (or whatever) build I ever > create. The build number is added to the MANIFEST.MF file in jars and > wars, and can be included in the version or finalname elements of the > pom if needed.
With Subversion I'm sure that you can ask for the revision of the file directly from the remote repository like this: $ svn info https://svn.codehaus.org/mojo/trunk/ I'm pretty sure that support for reading the SCM URL from a working copy was added a while back so that should be pretty easy to implement in Maven SCM as it is. > Of course, I'm happy to contribute anything I can, in whatever way I > can. I'll publish it on Monday so that anyone who is interested can > take a look. That would be appreciated, please read and follow [1]. [1]: http://mojo.codehaus.org/development/submitting-a-plugin.html -- Trygve
