Excelsior JET Maven Plugin

The Excelsior JET Maven Plugin, enables you to add support for native builds to your existing Maven projects with ease. It is being developed as an open source project hosted on GitHub, and is available on Maven Central.

The current version supports four types of applications:

  • Plain Java SE applications, defined as applications that (a) can be run with all dependencies explicitly listed on the command-line of the conventional java launcher: java [-cp dependencies-list] main-class and (b) load classes mostly from the listed jars.
  • Tomcat Web applications.war files that can be deployed to the Apache Tomcat application server.
  • Invocation dynamic libraries (e.g. Windows DLLs) callable from non-JVM languages
  • Java applications disguised as Windows services using the Excelsior JET WinService API

Assuming that a copy of Excelsior JET is accessible via the operating system PATH, all you need to use it in a project is:

  1. Copy and paste the following configuration into the <plugins> section of your pom.xml file:

    <plugin>
        <groupId>com.excelsiorjet</groupId>
        <artifactId>excelsior-jet-maven-plugin</artifactId>
        <version>1.0.0</version>
        <configuration>
            <mainClass></mainClass>
        </configuration>
    </plugin>

  2. Set the <mainClass> parameter, and

  3. Run Maven with the jet:build goal:

    mvn jet:build
  1. Copy and paste the following configuration into the <plugins> section of your pom.xml file:

    <plugin>
        <groupId>com.excelsiorjet</groupId>
        <artifactId>excelsior-jet-maven-plugin</artifactId>
        <version>1.0.0</version>
        <configuration>
            <tomcatConfiguration>
                 <tomcatHome></tomcatHome>
            </tomcatConfiguration>
        </configuration>
    </plugin>

  2. Set the <tomcatHome> parameter to point to the master Tomcat installation — basically, a clean Tomcat instance that was never launched, and

  3. Run Maven with the jet:build goal:

    mvn jet:build
  1. Copy and paste the following configuration into the <plugins> section of your pom.xml file:

    <plugin>
        <groupId>com.excelsiorjet</groupId>
        <artifactId>excelsior-jet-maven-plugin</artifactId>
        <version>1.0.0</version>
        <configuration>
            <appType>dynamic-library</appType>
        </configuration>
    </plugin>
  2. Run Maven with the jet:build goal:

    mvn jet:build

Warning Testing and using dynamic libraries that expose Java APIs is tricky. Make sure to read the respective section of the plugin documentation.

  1. Add a dependency on the Excelsior JET WinService API to your Maven project, e.g. by copying and pasting the following snippet to the <dependencies> section of your pom.xml file:

    <dependency>
        <groupId>com.excelsiorjet</groupId>
        <artifactId>excelsior-jet-winservice-api</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
    </dependency>
  2. Implement a subclass of com.excelsior.service.WinService as described in the Excelsior JET WinService API documentation.

  3. Copy and paste the following configuration into the <plugins> section of your pom.xml file:

    <plugin>
        <groupId>com.excelsiorjet</groupId>
        <artifactId>excelsior-jet-maven-plugin</artifactId>
        <version>1.0.0</version>
        <configuration>
            <appType>windows-service</appType>
            <main>service-main</main>
            <windowsServiceConfiguration>
                <name></name>
                <displayName></displayName>
                <description></description>
                <arguments>
                    <argument></argument>
                </arguments>
                <logOnType></logOnType>
                <allowDesktopInteraction></allowDesktopInteraction>
                <startupType></startupType>
                <startServiceAfterInstall></startServiceAfterInstall>
                <dependencies>
                     <dependency></dependency>
                </dependencies>
            </windowsServiceConfiguration>
        </configuration>
    </plugin>

    where service-main is the name of the class that you implemented on the previous step. For descriptions of all other parameters, refer to plugin documentation.

  4. Run Maven with the jet:build goal:

    mvn jet:build

For more information about Windows services support in Excelsior JET, refer to to the "Windows Services" Chapter of the Excelsior JET for Windows User's Guide.


Refer to plugin documentation for further instructions.