Plugin Documentation

Goals available for this plugin:

Goal Description
j2cl:build Transpiles this project and all of its dependencies, then combines them all into a single JS executable.
j2cl:clean A goal to clean cached J2cl/GWT3 build outputs. This goal is meant to support the case where the cache is moved outside of the default location in target, and handle the cases where the user needs to manually run clean. When working on more than one j2cl-maven-plugin project locally, it can he helpful to specify a global shared cache that all projects should share, so that when any artifact is built it can be reused.
j2cl:test Discovers any tests referenced by @J2clTestInput, compiles them to JavaScript, and runs them in the configured browser. Presently this defaults to using optimizationLevel=BUNDLE_JAR and webdriver=HTMLUNIT, though these are actually incompatible (HtmlUnit is not compatible with the es6 "class" keyword, and BUNDLE_JAR avoids transpiling to es3, so a project using this goal must change one or the other to get started.
j2cl:watch Attempts to do the setup for various test and build goals declared in the current project or in child projects, but also allows the configuration for this goal to further customize them. For example, this goal will be configured to use a particular compilation level, or directory to copy output to. If run in a parent pom, the webappDirectory configuration must be set.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 2.0
JDK 11
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.vertispan.j2cl</groupId>
          <artifactId>j2cl-maven-plugin</artifactId>
          <version>0.21.0</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>com.vertispan.j2cl</groupId>
        <artifactId>j2cl-maven-plugin</artifactId>
        <version>0.21.0</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"