This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven or Ant: SVN revision Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven or Ant: SVN revision" Watch "Maven or Ant: SVN revision" New topic
Author

Maven or Ant: SVN revision

Janko Mlakar
Greenhorn

Joined: Mar 20, 2010
Posts: 7
Is it possible to gather SVN revision and add it to one java file (or application.properties) automatically during build period using ant or maven?

I'm trying to get versioning based on SVN revision.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

For Ant, look at the svnant task, specifically the 'info' command:
http://subclipse.tigris.org/svnant/svn.html#info

That should get you the revision number into a property. Then use the copy task with an 'expandProperties' 'filterChain' to place the revision into the desired file.


JBoss In Action
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

VCS version numbers make pretty lousy software release version numbers. I've been down that route, and they just don't track nicely. In CVS, it's compounded by the fact that each file has its own version number, based on the number of updates made to it.

I used have a "build version # bump" task in my Ant build files. Maven can do a complete release control action, including bumping the version number in the POM. It handles both snapshot (development release) versioning and production versioning.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven or Ant: SVN revision
 
Similar Threads
jdo and eclipse
Build with maven
Maven Vs Ant
maven scm plugin: svn revision
whats the diff. b/w ANT and MAVEN?