RSS Feeds for Subversion
Posted by: Matt in Software development, Web tools, tags: java, JDOM, RSS, Subversion, toolsI needed an application, available to my entire development team, to provide RSS feeds for commit activity in our Subversion repository. I found a couple of items that looked reasonable, but they required scripting languages I could not use in my environment - I needed a Java-based solution.
So I decided to write it.
To access Subversion, I used SVNKit, an all-java library for SVN access. To create the RSS feed file (which is just an XML file) I used JDOM, my favorite XML handling library.
To deploy it, just deploy the WAR File to your Servlet container. SvnRss web archive (WAR file)
To use it, hit the app, passing the SVN url as a query parameter (if your aggregator gives you trouble, try URL encoding it). If you need to authenticate to access the repository, specify uid=yourusername and pwd=password as query parameters as well. By default, the feed includes the last 100 revisions, but you can override this with the numRevisions=nn query parameter.
Example invocations:
http://yourserver/SvnRss/SvnRssServlet?svnUrl=svn://yourrepository:1230/java/trunk
http://yourserver/SvnRss/SvnRssServlet?svnUrl=svn://yourrepository:1230/java/trunk&uid=kescobar&pwd=whatsamanmonth
http://yourserver/SvnRss/SvnRssServlet?svnUrl=svn://yourrepository:1230/java/trunk&numRevisions=25
The source code (in an Eclipse project) is also available. SvnRss source code (Zip file)

Entries (RSS)
curious, what does your team use for RSS reader? (same one or anything goes?)
Pretty much anything goes. For stuff that’s internal to the trusted network, I use Outlook 2007’s built-in RSS feature, which makes new items show up like emails in a special folder. For stuff outside the trusted network (like your blog) I use myyahoo.com. At least one of my teammates uses Google Desktop, though.
Not surprisingly, we also use Hudson’s RSS feeds to get notified about build activity (usually just failures).
[...] was reading a friend’s blog post about RSS feeds for Subversion repositories earlier… he couldn’t find anything that was not written in a scripting [...]
Everyone reading this should also to go over to Mike’s blog (http://blog.huikau.com) and see how he basically did the same thing I did using Ruby, with JRuby as the execution environment.
FYI: if you are already using Hudson for continuous integration, it’s already got RSS feeds for change log built in. But this was a fun!
Pretty close, but not exactly. Hudson’s built-in RSS Feeds are for builds (successes and failures), which aren’t exactly the same thing, since not everything you check in necessarily equates to a build. In addition, Hudson’s RSS feeds will group together all the checkins that were picked up in a particular build; the RSS Servlet gives you one entry per log entry in Subversion.