IDEA and OpenNMS

From OpenNMS
Jump to navigation Jump to search


Importing the OpenNMS project into the IntelliJ IDE and make all necessary settings is the topic of this wiki site.


The OpenNMS development team has been granted an OpenSource License for IntelliJ's IDEA. This unfortunately means it is not free for the entire community, but yet a very valuable tool.


Using IDEA

Build OpenNMS

  • OpenNMS has to be build from command line first before its imported into IntelliJ
  • Open a terminal window
  • Check out the source as normal
  • Change to the root directory of the OpenNMS project
  • On the command line execute
./ && ./ -DskipTests && ./ -p dir

IntelliJ settings

These settings are necessary to be consistent with eclipse created files for classes and interfaces


  • Unzip the .zip and you will see a directory structure as in the screenshot right below
  • On the left screenshot below you see the directory used by the IntelliJ IDE to store settings, caches, plugins and logs
  • In the case of Linux its in the users home directory. If you use OS X or Windows, the location of this directory is different. More infos you find here
  • Some of the directories in the right and left have maching directory names
  • Copy all files from right to left into the directory with the same name. Don't forget the subdirectories

Copy files.png

  • You should have copied these files from right to left:

  • Start IntelliJ and the welcome dialog will open
  • Navigate to Configure -> Settings


  • On the left side click Build, Execution, Deployment -> Build Tools -> Maven -> Importing
  • Here you have to make 2 changes, which are not by default
  • Check Import Maven projects automatically
  • In the input field VM options for importer type in the value -Xmx4096m
  • Click Apply


  • Navigate to File -> Settings -> Editor -> General -> Autoimport
  • Check Optimize imports on the fly
  • Click Apply


  • Navigate to Editor -> Inspections
  • On the right is a drop down called Profile. There select opennms
  • Confirm that anything related to osgi is unchecked
  • HINT The community version doesn't provide OSGi features!
  • Click Apply


  • Navigate to Editor -> Code Style
  • On the right is a drop down called Scheme. There select opennms
  • Click Apply and OK


Import OpenNMS

This section describes how OpenNMS is imported into IntelliJ IDE.

  • You can now click Import Project


  • Navigate to the directory where OpenNMS was cloned to mark it and click OK


  • Enable the option Import projects from external model and mark Maven in the list below
  • Click Next


  • No changes necessary, click Next

After maven.png

  • Please make sure, that the following profiles are selected:
    • assemblies
    • jdk7+
    • smoke
  • Afterwards, click Next


  • No changes necessary, click Next

After jdk.png

  • Click the plus icon and then click JDK


  • Navigate to the Java jdk root directory (it must be Oracle Java, not OpenJDK)
  • Mark it and click OK


  • The result is a classpath set with jar files like in the screenshot below
  • Click Next


  • You can choose a project name
  • click Finish


  • This is now the main screen of Intellij
  • You may see warnings on the top right
  • One is about inotify optimization. Please click the related link in the IDE for further information.
  • One is about Unregistered VCS root detected. You can click Add root to link the root of the project to your local git repository.
  • If you click on process running in the status bar you can see the progress of maven tasks (this can last 10-30 min depending on internet connection and hardware)


  • When all is finished you see the OpenNMS project structure imported


IntelliJ Debugging

  • OpenNMS has to be started with debug mode options
./bin/opennms -vt start
  • Navigate to Run -> Edit configurations...
  • Press the green plus icon and select Remote


  • Choose a name
  • Type in 8001 as port number


Performance Improvement

Change IDEA Settings

  • Open Help -> Edit Custom VM Options...
  • Change the following lines
  • restart IntelliJ

Change OS Settings

Linux only:

  • restart IntelliJ


Error: Project SDK or Error: Project language level

You may get an error regarding Project SDK or Project language level. In that case do settings settings below

  • Right click on project root and click Open Module Settings


  • Navigate to Project Settings -> Project
  • For Project SDK select Java 1.8
  • For Project language level selet 8 - Lambdas, type annotations. etc.
  • Click OK

OpenNMS has been successfully imported into the IntelliJ IDE now


Error: osgi: [opennms-osgi-core] Manifest file '-osgi.bnd' missing - please check OSGi facet settings.

Answer from Markus von Rüden: At the bottom of the Run/Debug Configurations screen in the Before launch section, remove Build and add Build, no error check. See this for details: