j2cl:build

Full name:

com.vertispan.j2cl:j2cl-maven-plugin:0.21.0:build

Description:

Transpiles this project and all of its dependencies, then combines them all into a single JS executable.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile+runtime.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Binds by default to the lifecycle phase: prepare-package.

Required Parameters

Name Type Since Description
<bootstrapClasspath> String - (no description)
Default value is: com.vertispan.j2cl:javac-bootstrap-classpath:0.11.0-9336533b6.
Alias is: javacBootstrapClasspathJar.
<bootstrapJsZip> String - (no description)
Default value is: com.vertispan.j2cl:bootstrap:zip:jszip:0.11.0-9336533b6.
<gwt3BuildCacheDir> File - Specifies the path to the build cache. This defaults to a directory in target, but for easier reuse and faster builds between projects, it can make sense to set this globally to a shared directory.
Default value is: ${project.build.directory}/gwt3BuildCache.
User property is: gwt3.cache.dir.
<initialScriptFilename> String - The path within webappDirectory to write the JavaScript file generated by this goal.
Default value is: ${project.artifactId}/${project.artifactId}.js.
<internalAnnotationsJar> String - (no description)
Default value is: com.vertispan.j2cl:gwt-internal-annotations:0.11.0-9336533b6.
<jreJar> String - (no description)
Default value is: com.vertispan.j2cl:jre:0.11.0-9336533b6.
<jreJsZip> String - (no description)
Default value is: com.vertispan.j2cl:jre:zip:jszip:0.11.0-9336533b6.
<jsinteropAnnotationsJar> String - (no description)
Default value is: com.google.jsinterop:jsinterop-annotations:2.0.0.
<junitAnnotations> String - (no description)
Default value is: com.vertispan.j2cl:junit-annotations:0.11.0-9336533b6.
<localBuildCache> File - (no description)
Default value is: ${project.build.directory}/j2cl-maven-plugin-local-cache.
<testJsZip> String - (no description)
Default value is: com.vertispan.j2cl:closure-test:zip:jszip:0.11.0-9336533b6.
<webappDirectory> String - The output directory for this goal. Note that this is used in conjunction with initialScriptFilename so that more than one goal or even project can share the same webappDirectory, but have their own sub-directory and output file.
Default value is: ${project.build.directory}/${project.build.finalName}.

Optional Parameters

Name Type Since Description
<annotationProcessorMode> AnnotationProcessorMode - (no description)
Default value is: AVOID_MAVEN.
<checkAssertions> boolean - Whether or not to leave Java assert checks in the compiled code. In j2cl:build, defaults to true. Has no effect when the compilation level isn't set to ADVANCED_OPTIMIZATIONS, assertions will always remain enabled.
Default value is: false.
<compilationLevel> String - Describes how the output should be built - presently supports five modes, four of which are closure-compiler "compilationLevel" argument options, and an additional special case for J2cl-base applications. The quoted descriptions here explain how closure-compiler defines them.
  • ADVANCED_OPTIMIZATIONS - "ADVANCED_OPTIMIZATIONS aggressively reduces code size by renaming function names and variables, removing code which is never called, etc." This is typically what is expected for production builds.
  • SIMPLE_OPTIMIZATIONS - "SIMPLE_OPTIMIZATIONS performs transformations to the input JS that do not require any changes to JS that depend on the input JS." Generally not useful in this plugin - slower than BUNDLE, much bigger than ADVANCED_OPTIMIZATIONS
  • WHITESPACE_ONLY - "WHITESPACE_ONLY removes comments and extra whitespace in the input JS." Generally not useful in this plugin - slower than BUNDLE, much bigger than ADVANCED_OPTIMIZATIONS
  • BUNDLE - "Simply orders and concatenates files to the output." The GWT fork of closure also prepends define statements, and provides wiring for sourcemaps.
  • BUNDLE_JAR - Not a "real" closure-compiler option. but instead invokes BUNDLE on each classpath entry and generates a single JS file which will load those bundled files in order. Enables the compiler to cache results for each dependency, rather than re-generate a single large JS file.

Default value is: ADVANCED_OPTIMIZATIONS.
User property is: compilationLevel.
<defines> Map - Closure flag: "Override the value of a variable annotated @define. The format is &lt;name&gt;[=&lt;val&gt;], where &lt;name&gt; is the name of a @define variable and &lt;val&gt; is a boolean, number, or a single-quoted string that contains no single quotes. If [=&lt;val&gt;] is omitted, the variable is marked true" In this plugin the format is to provided tags for each define key, where the text contents will represent the value. In the context of J2CL and Java, this can be used to define values for system properties.
<dependencyMode> String - Deprecated. Will be removed in 0.21
Default value is: SORT_ONLY.
<dependencyReplacements> List - (no description)
<enableSourcemaps> boolean - True to enable sourcemaps to be built into the project output.
Default value is: false.
<entrypoint> List - Deprecated. Will be removed in 0.21
<env> String - Closure flag: "Determines the set of builtin externs to load. Options: BROWSER, CUSTOM. Defaults to BROWSER." Presently we default to BROWSER, but are considering changing this to CUSTOM if we include externs files in the generate jsinterop artifacts, so that each set of bindings is self-contained.
Default value is: BROWSER.
<externs> Set - Deprecated. Will be removed in 0.21
<incrementalEnabled> boolean - (no description)
Default value is: false.
User property is: j2cl.incremental.
<languageOut> String - ECMAScript language level of generated JavasScript. Values correspond to the Closure Compiler reference: https://github.com/google/closure-compiler/wiki/Flags-and-Options
Default value is: ECMASCRIPT5.
User property is: languageOut.
<rewritePolyfills> boolean - Closure flag: "Rewrite ES6 library calls to use polyfills provided by the compiler's runtime." Unlike in closure-compiler, defaults to false.
Default value is: false.
<shutdownWaitSeconds> int - (no description)
<taskMappings> Map - (no description)
<translationsFile> TranslationsFileConfig - Closure flag: "Source of translated messages. Currently only supports XTB."
<workerThreadCount> String - (no description)

Parameter Details

<annotationProcessorMode>

(no description)
  • Type: com.vertispan.j2cl.mojo.AnnotationProcessorMode
  • Required: No
  • Default: AVOID_MAVEN

<bootstrapClasspath>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:javac-bootstrap-classpath:0.11.0-9336533b6
  • Alias: javacBootstrapClasspathJar

<bootstrapJsZip>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:bootstrap:zip:jszip:0.11.0-9336533b6

<checkAssertions>

Whether or not to leave Java assert checks in the compiled code. In j2cl:build, defaults to true. Has no effect when the compilation level isn't set to ADVANCED_OPTIMIZATIONS, assertions will always remain enabled.
  • Type: boolean
  • Required: No
  • Default: false

<compilationLevel>

Describes how the output should be built - presently supports five modes, four of which are closure-compiler "compilationLevel" argument options, and an additional special case for J2cl-base applications. The quoted descriptions here explain how closure-compiler defines them.
  • ADVANCED_OPTIMIZATIONS - "ADVANCED_OPTIMIZATIONS aggressively reduces code size by renaming function names and variables, removing code which is never called, etc." This is typically what is expected for production builds.
  • SIMPLE_OPTIMIZATIONS - "SIMPLE_OPTIMIZATIONS performs transformations to the input JS that do not require any changes to JS that depend on the input JS." Generally not useful in this plugin - slower than BUNDLE, much bigger than ADVANCED_OPTIMIZATIONS
  • WHITESPACE_ONLY - "WHITESPACE_ONLY removes comments and extra whitespace in the input JS." Generally not useful in this plugin - slower than BUNDLE, much bigger than ADVANCED_OPTIMIZATIONS
  • BUNDLE - "Simply orders and concatenates files to the output." The GWT fork of closure also prepends define statements, and provides wiring for sourcemaps.
  • BUNDLE_JAR - Not a "real" closure-compiler option. but instead invokes BUNDLE on each classpath entry and generates a single JS file which will load those bundled files in order. Enables the compiler to cache results for each dependency, rather than re-generate a single large JS file.
  • Type: java.lang.String
  • Required: No
  • User Property: compilationLevel
  • Default: ADVANCED_OPTIMIZATIONS

<defines>

Closure flag: "Override the value of a variable annotated @define. The format is &lt;name&gt;[=&lt;val&gt;], where &lt;name&gt; is the name of a @define variable and &lt;val&gt; is a boolean, number, or a single-quoted string that contains no single quotes. If [=&lt;val&gt;] is omitted, the variable is marked true" In this plugin the format is to provided tags for each define key, where the text contents will represent the value. In the context of J2CL and Java, this can be used to define values for system properties.
  • Type: java.util.Map
  • Required: No

<dependencyMode>

Deprecated. Will be removed in 0.21
(no description)
  • Type: java.lang.String
  • Required: No
  • Default: SORT_ONLY

<dependencyReplacements>

(no description)
  • Type: java.util.List
  • Required: No

<enableSourcemaps>

True to enable sourcemaps to be built into the project output.
  • Type: boolean
  • Required: No
  • Default: false

<entrypoint>

Deprecated. Will be removed in 0.21
(no description)
  • Type: java.util.List
  • Required: No

<env>

Closure flag: "Determines the set of builtin externs to load. Options: BROWSER, CUSTOM. Defaults to BROWSER." Presently we default to BROWSER, but are considering changing this to CUSTOM if we include externs files in the generate jsinterop artifacts, so that each set of bindings is self-contained.
  • Type: java.lang.String
  • Required: No
  • Default: BROWSER

<externs>

Deprecated. Will be removed in 0.21
(no description)
  • Type: java.util.Set
  • Required: No

<gwt3BuildCacheDir>

Specifies the path to the build cache. This defaults to a directory in target, but for easier reuse and faster builds between projects, it can make sense to set this globally to a shared directory.
  • Type: java.io.File
  • Required: Yes
  • User Property: gwt3.cache.dir
  • Default: ${project.build.directory}/gwt3BuildCache

<incrementalEnabled>

(no description)
  • Type: boolean
  • Required: No
  • User Property: j2cl.incremental
  • Default: false

<initialScriptFilename>

The path within webappDirectory to write the JavaScript file generated by this goal.
  • Type: java.lang.String
  • Required: Yes
  • Default: ${project.artifactId}/${project.artifactId}.js

<internalAnnotationsJar>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:gwt-internal-annotations:0.11.0-9336533b6

<jreJar>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:jre:0.11.0-9336533b6

<jreJsZip>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:jre:zip:jszip:0.11.0-9336533b6

<jsinteropAnnotationsJar>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.google.jsinterop:jsinterop-annotations:2.0.0

<junitAnnotations>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:junit-annotations:0.11.0-9336533b6

<languageOut>

ECMAScript language level of generated JavasScript. Values correspond to the Closure Compiler reference: https://github.com/google/closure-compiler/wiki/Flags-and-Options
  • Type: java.lang.String
  • Required: No
  • User Property: languageOut
  • Default: ECMASCRIPT5

<localBuildCache>

(no description)
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/j2cl-maven-plugin-local-cache

<rewritePolyfills>

Closure flag: "Rewrite ES6 library calls to use polyfills provided by the compiler's runtime." Unlike in closure-compiler, defaults to false.
  • Type: boolean
  • Required: No
  • Default: false

<shutdownWaitSeconds>

(no description)
  • Type: int
  • Required: No

<taskMappings>

(no description)
  • Type: java.util.Map
  • Required: No

<testJsZip>

(no description)
  • Type: java.lang.String
  • Required: Yes
  • Default: com.vertispan.j2cl:closure-test:zip:jszip:0.11.0-9336533b6

<translationsFile>

Closure flag: "Source of translated messages. Currently only supports XTB."
  • Type: com.vertispan.j2cl.mojo.TranslationsFileConfig
  • Required: No

<webappDirectory>

The output directory for this goal. Note that this is used in conjunction with initialScriptFilename so that more than one goal or even project can share the same webappDirectory, but have their own sub-directory and output file.
  • Type: java.lang.String
  • Required: Yes
  • Default: ${project.build.directory}/${project.build.finalName}

<workerThreadCount>

(no description)
  • Type: java.lang.String
  • Required: No