You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Allan Ditzel <al...@gmail.com> on 2009/05/05 16:11:59 UTC

Retrieving current revision from SCM

Hi all,

I'm trying to do the following:

We're using subversion and we need to extract the revision number of the
working copy and put that in a properties file. Is there an existing plugin
available to do this? I looked at the documentation for the SCM plugin and
it doesn't seem to quite fit the bill in order to do this.

Thanks!

Allan

Re: Retrieving current revision from SCM

Posted by Allan Ditzel <al...@gmail.com>.
Thanks, everyone!

We were finally able to get the resources filtered in our war pom, and the
version is now being inserted into a properties file.

Thanks again!

Allan

On Tue, May 5, 2009 at 5:46 PM, Andrei Solntsev <as...@hireright.ee>wrote:

> Allan,
> In our company we also need to know exact revision number of each file
> in project. The proposed "buildnumber" doesn't suit well, we need
> exactly revision numbers!
>
> We have created a custom version of maven-scm-plugin which supports this
> feature. I am going to commit patch to maven-scm 1.3-SNAPSHOT soon.
>
>
> Andrei Solntsev,
> Software Developer
>
> HireRight Estonia AS
>
> -----Original Message-----
> From: Allan Ditzel [mailto:allan.ditzel@gmail.com]
> Sent: Tuesday, May 05, 2009 5:12 PM
> To: users@maven.apache.org
> Subject: Retrieving current revision from SCM
>
> Hi all,
>
> I'm trying to do the following:
>
> We're using subversion and we need to extract the revision number of the
> working copy and put that in a properties file. Is there an existing
> plugin
> available to do this? I looked at the documentation for the SCM plugin
> and
> it doesn't seem to quite fit the bill in order to do this.
>
> Thanks!
>
> Allan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Retrieving current revision from SCM

Posted by Andrei Solntsev <as...@hireright.ee>.
Allan,
In our company we also need to know exact revision number of each file
in project. The proposed "buildnumber" doesn't suit well, we need
exactly revision numbers!

We have created a custom version of maven-scm-plugin which supports this
feature. I am going to commit patch to maven-scm 1.3-SNAPSHOT soon.


Andrei Solntsev,
Software Developer 

HireRight Estonia AS

-----Original Message-----
From: Allan Ditzel [mailto:allan.ditzel@gmail.com] 
Sent: Tuesday, May 05, 2009 5:12 PM
To: users@maven.apache.org
Subject: Retrieving current revision from SCM

Hi all,

I'm trying to do the following:

We're using subversion and we need to extract the revision number of the
working copy and put that in a properties file. Is there an existing
plugin
available to do this? I looked at the documentation for the SCM plugin
and
it doesn't seem to quite fit the bill in order to do this.

Thanks!

Allan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Retrieving current revision from SCM

Posted by Lachlan Deck <la...@gmail.com>.
I've been using this:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>buildnumber-maven-plugin</artifactId>
	<version>1.0-beta-1</version>
	<executions>
		<execution>
			<phase>validate</phase>
			<goals>
				<goal>create</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<doCheck>false</doCheck>
		<doUpdate>false</doUpdate>
	</configuration>
</plugin>

And in a resource properties file that's filtered:
scm.version=${buildNumber}

On 06/05/2009, at 1:20 AM, Allan Ditzel wrote:

> Thanks Olivier!
>
> That _almost_ does it. If I don't specify <format> and <items> then  
> I see
> the correct revision printed on screen when the module builds. But I  
> can't
> seem to find the right format and items to read the buildNumber in  
> the file.
>
> Here is what I have in my <configuration> block for the plugin:
>
> <format>{0,number}</format>
> <items><item>buildNumber</item></items>
>
> And the file output is:
>
> #maven.buildNumber.plugin properties file
> #Tue May 05 11:16:55 EDT 2009
> buildNumber=1
>
> I know I have to be missing something rather simple here. Any  
> thoughts?
>
> Thanks again!
>
> Allan
>
> On Tue, May 5, 2009 at 10:24 AM, Olivier Lamy <ol...@apache.org>  
> wrote:
>
>> Hi,
>> Have a look here : http://mojo.codehaus.org/buildnumber-maven-plugin/
>>
>> HTH,
>> --
>> Olivier
>>
>> 2009/5/5 Allan Ditzel <al...@gmail.com>:
>>> Hi all,
>>>
>>> I'm trying to do the following:
>>>
>>> We're using subversion and we need to extract the revision number  
>>> of the
>>> working copy and put that in a properties file. Is there an existing
>> plugin
>>> available to do this? I looked at the documentation for the SCM  
>>> plugin
>> and
>>> it doesn't seem to quite fit the bill in order to do this.
>>>
>>> Thanks!
>>>
>>> Allan
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

with regards,
--

Lachlan Deck




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Retrieving current revision from SCM

Posted by Allan Ditzel <al...@gmail.com>.
Thanks Olivier!

That _almost_ does it. If I don't specify <format> and <items> then I see
the correct revision printed on screen when the module builds. But I can't
seem to find the right format and items to read the buildNumber in the file.

Here is what I have in my <configuration> block for the plugin:

<format>{0,number}</format>
<items><item>buildNumber</item></items>

And the file output is:

#maven.buildNumber.plugin properties file
#Tue May 05 11:16:55 EDT 2009
buildNumber=1

I know I have to be missing something rather simple here. Any thoughts?

Thanks again!

Allan

On Tue, May 5, 2009 at 10:24 AM, Olivier Lamy <ol...@apache.org> wrote:

> Hi,
> Have a look here : http://mojo.codehaus.org/buildnumber-maven-plugin/
>
> HTH,
> --
> Olivier
>
> 2009/5/5 Allan Ditzel <al...@gmail.com>:
> > Hi all,
> >
> > I'm trying to do the following:
> >
> > We're using subversion and we need to extract the revision number of the
> > working copy and put that in a properties file. Is there an existing
> plugin
> > available to do this? I looked at the documentation for the SCM plugin
> and
> > it doesn't seem to quite fit the bill in order to do this.
> >
> > Thanks!
> >
> > Allan
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Retrieving current revision from SCM

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Have a look here : http://mojo.codehaus.org/buildnumber-maven-plugin/

HTH,
--
Olivier

2009/5/5 Allan Ditzel <al...@gmail.com>:
> Hi all,
>
> I'm trying to do the following:
>
> We're using subversion and we need to extract the revision number of the
> working copy and put that in a properties file. Is there an existing plugin
> available to do this? I looked at the documentation for the SCM plugin and
> it doesn't seem to quite fit the bill in order to do this.
>
> Thanks!
>
> Allan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org