Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Donkey Hottie Newsgroups: comp.lang.java.programmer Subject: Re: Get Rev Number from SVN to Display in Web App Date: Tue, 08 May 2012 14:13:21 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="2CZGuqNdT70amojVWJXwUg"; logging-data="6093"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yfjPWpar+bDIWlq9i9ati" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: X-Antivirus-Status: Clean X-Antivirus: avast! (VPS 120508-0, 08.05.2012), Outbound message Cancel-Lock: sha1:fy3kkP0e+k5nFXE2oDpErH+IaEg= Xref: csiph.com comp.lang.java.programmer:14399 On 8.5.2012 13:15, Jan Burse wrote: > Dear All, > > Is there a simple Ant task to retrieve the revision > number of my code from a SVN repository, and then > store it in some location, so that later my web > application can show it? > > Best Regards Just put the "$Revision: $" into your source code, and if it is a jsp page, add echo "" >>the.jsp so it changes. You may play with tail so that you just replace the last line in the file with that time stamp. And have some Java utility to parse the revision number from the string "$Revision: 2020$" s.split(":")[1].replace('$',' ').trim(); So there. The page always will have the latest revision from version control in it. -- You shall be rewarded for a dastardly deed.