Skip to content

Getting started with developing an NPL Contributor Library

An NPL contributor library lets you package NPL constructs such as types and functions and share them with your NPL community. Referencing and declaring protocols is currently unsupported. Consider developing an NPL contributor library when several projects share similar NPL constructs.

Writing an NPL Contributor Library and general guidelines

The general components/layout of such a project are:

  1. the src/main/npl/sample and src/test/npl/sample directories
  2. the src/main/resources/config.json file
  3. usage of the maven-assembly-plugin and its assembly file src/main/resources/assembly.xml

sample should be replaced with an appropriate name for your project. All your NPL source files should be contained under 1 main directory.

The config.json for now only supports specifying a platform minimum version. This version is not checked while developing and testing but is checked when running a final release version of engine. SNAPSHOT and RC versions of engine will not check this platform minimum version. Such a config.json should be structured as following:

  "platform": {
    "minimum_version": "2024.1.1"

The maven-assembly-plugin is responsible for packaging the config.json and your NPL source files into a single NPL contrib zip file. Its configuration file src/main/resources/assembly.xml contains parameters for assembling it. The assembly.xml should be configured as following:

<assembly xmlns=""




You are free to choose how to version your NPL contributor library source files and your produced zip file. However, we recommend to version your NPL source files using a major version namespace & directories such as v1 and v2. This should make your life easier for patch & minor releases.

All versions of your NPL contributor library source files should be present in a single zip file for every release. Clients using your NPL contributor library defined NPL constructs must continue to use it once they use it in production, otherwise their environment will break.


After executing mvn package or mvn install a zip file named will be available. This zip file can then be used as a dependency in any NPL project.


You are free to choose where & how to publish your zip artifact as long as it supports Maven.

Integrating an NPL Contributor Library into an NPL project and in IntelliJ

To see a working example, git checkout our npl-starter project and peruse its pom.xml. If you can't, continue reading.

To your NPL project pom.xml:

  1. Add the published, or locally installed SNAPSHOT, NPL contrib as a zip dependency

  2. Add the maven-dependency-plugin before the npl-maven-plugin in the plugins section and specify where to copy the zip dependency. The outputDirectory should be the location where all your NPL contrib libraries are located for your NPL project. This is the same directory as your configured nplContribPath of the npl-maven-plugin, which defaults to ${project.basedir}/npl-contrib.

  3. Add the npl-contrib goal of the npl-maven-plugin. It will create an file at the root of your project to make the all zip files in npl-contrib discoverable for development using IntelliJ and the npl-idea-plugin. It is safe to add this to your .gitignore.



                        <!-- important step: the phase should be `generate-sources` -->
                            <!-- important step: `outputDirectory` should match `nplContribPath` of `npl-maven-plugin` -->
                            <goal>npl-contrib</goal> <!-- important step: this goal must be included -->
                        <!-- important step: should match the `outputDirectory` of the `copy-npl-contrib` execution of `maven-dependency-plugin` -->

Before the npl-contrib files can be discoverable in IntelliJ, mvn generate-sources or mvn compile will need to be executed. Alternatively, IntelliJ's Build can be configured to execute mvn compile before a Build and before a Rebuild by using the Maven lifecycle configuration window pane in IntelliJ.