Part 2.2: Importing your plugin into IntelliJ
This guide shows how to import a new plugin that was created using a Maven archetype into IntelliJ.
Prerequisites
Before using this guide ensure that you have installed Java, Apache Maven and IntelliJ on your computer as outlined in part 1: setting you your development environment, and have generated a new plugin using a Maven archetype.
Import a new plugin into IntelliJ
-
Open IntelliJ and click Open or Import. If you have previously opened a project you may need to select
from the menu. -
Navigate to the folder containing the new plugin that you created in the previous step (
my-plugins-directory/title-prefix-plugin
) and select thepom.xml
file. -
If you are prompted select that you wish to import the project as a
maven
project. -
If you are prompted to select an
SDK
chooseJDK 11
. This is the Java version installed in a previous step.
The same process can be used to import an existing plugin project into IntelliJ. |
Importing documentation from Maven
The Funnelback interfaces that you will be developing against include documentation. A key advantage of using an IDE such as IntelliJ is that this documentation is available from within the IDE.
Some additional configuration steps are required in order for the documentation to be available from within IntelliJ:
-
Open the preferences window by selecting
from the menu. -
Search for
maven
in the menu and click on theImporting
item. -
Tick the boxes for
Automatically download:
Sources, Documentation and Annotations. -
Click Apply, then click OK.
Exploring the imported project
The imported project is now ready to use. Expand the project structure by clicking on the Project tab then expanding out the project tree.
There are five main files of interest:

-
PluginUtils
: This class defines helpful methods that are specific to writing your plugin. -
TitlePrefixPluginSearchLifeCyclePlugin
: This contains the code that implements the functionality of the plugin. In this example there is only a singleTitlePrefixPluginSearchLifeCyclePlugin
file included in this folder as we only generatedsearchLifeCycle
when generating the plugin. A file is created here for each interface template that was selected when the plugin was generated from the Maven archetype. -
TitlePrefixPluginSearchLifeCyclePluginTest
: This contains code that implements unit tests to make sure the plugin is working correctly. A test file will be generated for each interface that was selected when generating the plugin in the same way as for the main plugin code above. Unit testing of plugins are covered in more detail in the testing section of the tutorial. -
pom.xml
: This file defines a number of parameters that maven uses to package the project. Other libraries required by the plugin will automatically be added to this by IntelliJ. -
README.md
: This file includes documentation for the plugin and must be included for every plugin.