• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven or Ant: SVN revision

 
Janko Mlakar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic