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.

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.

J


On Feb 10, 2006, at 4:35 PM, Miguel Griffa wrote:

in svn it'd be easy, but in cvs it'd be quite difficult, the 'newest' file may be a 1.2 revision,
mixing a little development process and policies, one could ask to write the revision id of the pom.xml, since that file should change at least once on each release, and thus, would be a valid identifier for the 'build number', IMHO this is an acceptable thing to ask

 
On 1/31/06, Trygve Laugstøl <[EMAIL PROTECTED]> wrote:
On Sun, 2006-01-22 at 01:15 -0300, Miguel Griffa wrote:
> Hi all
>   I was wondering if there would be any interest in hosting a build
> number plugin at mojo.
> For political reasons, I need this functionallity in a project, in
> this case read
> political = stupid + closed to discussion.
>   Any ideas?

I'd like the scm plugin to be able to write the "revision id" to a
properties file or a Java file which we'll run when building test and
production artifacts.

Not sure now to handle SCMs without a change set notion like CVS, the
only real option that I can think of is to find the newest file in the
repository and use that file's date as the id.

--
Trygve




--
Miguel Griffa
Skype: miguel.griffa
Y!: m_griffa
MSN: [EMAIL PROTECTED]
Cell: 54-911-62519355

Reply via email to