Multiple projects with OpenGrok

7.3k views Asked by At

I was just wondering what is the best way to setup and configure OpenGrok for multiple projects, e.g. via a single page and a dropdown list.

While the documentation for a single project is pretty straight-forward, the instructions for setting up a multi-project environment isn't very clear to me.

3

There are 3 answers

0
Ivo Bosticky On

Each directory under SRC_ROOT directory is one project. So create your directory structure should look something like this:

/opengrok
|-- bin
|-- data
`-- source
   |--project1
   |--project2
   `--project3

Then update your index, in this step the configuration.xml file will be updated and each directory under SRC_ROOT (or opengrok/source) will be considered to be a project.

0
Vineel On

I am on windows and to better handle the situation, I create a consolidated d:\opengroksrc folder which contains all my scattered source directories as directory junctions

Example I have a project in d:\gitsrc and another project in d:\hacksrc. I have created a folder named d:\opengroksrc

d:\opengroksrc '-gitsrc => hardlink to d:\gitsrc '-hacksrc => hardlink to d:\hacksrc
mklink /j d:\opengroksrc\gitsrc d:\gitsrc can be used to create a junction for a directory in windows

and in my web.xml I indicate that my source are actually coming from d:\opengroksrc

<context-param> <param-name>SRC_ROOT</param-name> <param-value>D:\opengroksrc\</param-value> </context-param>

And finally for indexing java -jar E:\opengrok\lib\opengrok.jar -a on -t 4 -W E:\opengrok\configuration.xml -c C:\Windows\ctags.exe -P -S -v -s D:\opengroksrc -d E:\opengrok\grokdata -I *.cs -I *.c -I *.cpp -I *.h -I *.xml

0
ajs2008 On

Go to the directory defined by OPENGROK_INSTANCE_BASE(for example: /var/opengrok) and create sub directory 'src' in this path. Then create soft links to your projects like following:

cd /var/opengrok/src
ln -s project1 <absolute path of project1>
ln -s project2 <absolute path of project2>
....

Finally update index by 'OpenGrok index'