How to build OpenGrok from source

Lubos Kosco edited this page Aug 20, 2018 · 26 revisions

Table of Contents

How to build {OpenGrok

The easiest way to build (or modify) {OpenGrok is by using any modern IDE, but you can also build {OpenGrok from the command line.


You need the following:

  • JDK 1.8 or higher
  • Maven
  • The source code is located in a git repository
  • First build has to happen with mvn which downloads all dependencies

Check out the source

The first thing you need to do is to check out the source code. You can check out the source with the following command:

 git clone

(or clone any of your forks)

Open correct project

OpenGrok does have a maven pom.xml for its modules.

Prepare the source for compilation

First build should download all needed dependencies, so don't get scared about missing jars.

Compile the source

If you use NetBeans you should be able to open OpenGrok as a project and build it from there. Specifically, open pom.xml from the root directory, and click Run => Build Project (opengrok). (Ignore "Resolve problem" for jar files other than junit, but setup a webapp server for the -web-nbproject application.)

If you want to build from the command line, execute the following command (it will need internet connection first time, so setup any proxies if needed):

 mvn compile

or (to clean and start from scratch)

 mvn clean compile
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.