Trond Norbye's Weblog

« Using CVS with OpenG... | Main | Using CVS with pserv... »

http://blogs.sun.com/trond/date/20090415 Wednesday April 15, 2009

Using Subversion with OpenGrok

In my previous blog entry Using CVS with OpenGrok I showed the steps needed to configure OpenGrok with CVS, and in this entry I will extend that example to include a project using Subversion.

The first thing we need to do is to install a Subversion client and check out the source code. I don't use Subversion for any of my projects, but Knut Anders is working on Apache Derby (hosted in a Subversion repository) so lets use that in this example.

trond@opensolaris> pfexec pkg install SUNWsvn
trond@opensolaris> cd /var/opengrok/source
trond@opensolaris> svn co https://svn.apache.org/repos/asf/db/derby/code/trunk derby

If we use the browser to navigate to http://localhost:8080/source/xref you will see a new directory named derby. The history links and selection box selection box in http://localhost:8080/source/ does however not work for Derby yet, so let's go ahead and update the configuration:

trond@opensolaris> cd /var/opengrok
trond@opensolaris> java -jar /var/opengrok/bin/opengrok.jar -c /var/opengrok/bin/ctags \
                              -v -s /var/opengrok/source -d /var/opengrok/data -S -P \
                              -p /opengrok -n -r on -W /etc/opengrok/configuration.xml

(run look at the man page for a description of the different options).

With the new configuration in place, we can start the index generation:

trond@opensolaris> cd /var/opengrok
trond@opensolaris> java -Xmx2g -jar /var/opengrok/bin/opengrok.jar -R /etc/opengrok/configuration.xml -H

With the new index database in place it is time to update the web application to use the new configuration:

trond@opensolaris> java -Xmx2g -jar /var/opengrok/bin/opengrok.jar -R /etc/opengrok/configuration.xml -n\
                                     -U localhost:2424

Or you could just restart the Tomcat web server:

trond@opensolaris> svcadm restart tomcat6

If you navigate to http://localhost:8080/source/history/derby/README you should get the history for the README file and the annotate link should be available. Subversion supports changesets so you should be able to request history for directories, but the directory information is not cached so this is a potentially slow operation (if you have remote SCM repositories).

Comments:

Cool to see that. OpenGrok is really great.

Posted by Jose Maria Silveira Neto on April 15, 2009 at 04:54 AM CEST #

Here, and at the OpenGrok site, configuration.xml is mentioned. However, it is never documented. In fact, OpenGrok's documentation sucks.

Posted by Brian on August 16, 2009 at 03:44 AM CEST #

So what do you want to know? If you look at the command line options you will find the option -W for writing the configuration file. We are currently working on trying to create a GUI to set all the different parameters, but due to the fact that this is a hobby project of mine (I don't get paid for working on OpenGrok) things take time. This is an opensource project, so please feel free to contribute with better documentation. You can also check out: http://lmgtfy.com/?q=opengrok+configuration.xml The installation guide gives you a step by step tour on how to install OpenGrok.....

Posted by Trond Norbye on August 16, 2009 at 10:02 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.