Skip to content
Adam Hornáček edited this page Jun 23, 2018 · 2 revisions

Clone repository

git clone https://github.com/Orviss/OpenGrok

IDE support

IntelliJ IDEA

  1. Open IDEA

  1. Click on Import Project

  2. Pick a path to the cloned project

  3. Click on Import project from external model and select Maven

  4. Wait for IDEA to index the project, you will see then:

  5. OpenGrok uses some generated sources, to generate them simply run mvn compile from terminal or from IDEA as shown on the image:

Now you're set and you can program ;)

How to run Indexer

  1. Select Run from the menu

  2. Click on Edit configurations...

  3. Click on +

  4. Select Application

  5. Select main class as org.opengrok.indexer.index.Indexer

  6. For option Use classpath of module: choose opengrok

  7. Add necessary program arguments

  8. Save

Final look:

How to deploy webapp

Install Tomcat 8 or newer

IntelliJ IDEA Ultimate Edition
  1. Select Run from the menu

  2. Click on Edit configurations...

  3. Click on +

  4. Select Tomcat Server -> Local

  5. In the Server tab select application server or click on Configure...

  6. In the Deployment tab select opengrok-web:war as in

IntelliJ IDEA Community Edition

There is no Tomcat support; therefore, we will use Tomcat Maven plugin

  1. Modify tomcat-users.xml to include <user username="admin1" password="admin1" roles="manager-script"/>

  2. Run Tomcat

  3. Modify ~/.m2/settings.xml to include:

<settings>
  <servers>
    <server>
      <id>OpenGrok</id>
      <username>admin1</username>
      <password>admin1</password>
    </server>
  </servers>
</settings>
  1. Install all packages either by mvn install or from IDEA the same way we ran compile

  2. Run mvn tomcat7:redeploy from opengrok-web directory or simply run it from IDEA:

Debugging webapp

IntelliJ IDEA Ultimate Edition

Simply debug from IDE

IntelliJ IDEA Community Edition

Run Tomcat with CATALINA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Debug as remote application