gwt:compile

Full name:

org.codehaus.mojo:gwt-maven-plugin:2.6.0:compile

Description:

Invokes the GWTCompiler for the project source. See compiler options : http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: prepare-package.

Required Parameters

Name Type Since Description
generateDirectory File - Folder where generated-source will be created (automatically added to compile classpath).
Default value is: ${project.build.directory}/generated-sources/gwt.

Optional Parameters

Name Type Since Description
checkAssertions boolean - Whether or not to enable assertions in generated scripts (-checkAssertions).
Default value is: false.
closureCompiler boolean 2.5.0-rc1 EXPERIMENTAL: Compile output Javascript with the Closure compiler for even further optimizations.

Can be set from the command line using '-Dgwt.compiler.enableClosureCompiler=true'


Default value is: false.
clusterFunctions boolean 2.6.0-rc1 EXPERIMENTAL: Cluster similar functions in the output to improve compression.
Default value is: true.
compileReport boolean 2.1.0-1 Compile a report that tells the "Story of Your Compile".

Can be set from command line using '-Dgwt.compiler.compileReport=true'.


Default value is: false.
compileSourcesArtifacts String[] - Artifacts to be included as source-jars in GWTCompiler Classpath. Removes the restriction that source code must be bundled inside of the final JAR when dealing with external utility libraries not designed exclusivelly for GWT. The plugin will download the source.jar if necessary. This option is a workaround to avoid packaging sources inside the same JAR when splitting and application into modules. A smaller JAR can then be used on server classpath and distributed without sources (that may not be desirable).
compilerMetrics boolean 2.5.0-rc1 EXPERIMENTAL: Gather compiler metrics.

Can be set from the command line using '-Dgwt.compiler.compilerMetrics=true'


Default value is: false.
deploy File 2.3.0-1 The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the webappDirectory directory/jar, and may be the same as the extra directory/jar)
detailedSoyc boolean 2.1.0-1 EXPERIMENTAL: Emit extra, detailed compile-report information in the "Story Of Your Compile" at the expense of compile time.

Can be set from command line using '-Dgwt.compiler.soycDetailed=true'.


Default value is: false.
disableAggressiveOptimization boolean 2.5.0-rc1 Deprecated. since 2.6.0-rc1
Default value is: false.
disableCastChecking boolean - EXPERIMENTAL: Disables run-time checking of cast operations.

Can be set from command line using '-Dgwt.disableCastChecking=true'.


Default value is: false.
disableClassMetadata boolean - EXPERIMENTAL: Disables some java.lang.Class methods (e.g. getName()).

Can be set from command line using '-Dgwt.disableClassMetadata=true'.


Default value is: false.
disableRunAsync boolean - EXPERIMENTAL: Disables code-splitting.

Can be set from command line using '-Dgwt.disableRunAsync=true'.


Default value is: false.
draftCompile boolean - Enable faster, but less-optimized, compilations.

Can be set from command line using '-Dgwt.draftCompile=true'.

This is equivalent to '-Dgwt.compiler.optimizationLevel=0 -Dgwt.compiler.disableAggressiveOptimization=true'.


Default value is: false.
enforceStrictResources boolean 2.6.0-rc1 EXPERIMENTAL: Avoid adding implicit dependencies on "client" and "public" for modules that don't define any dependencies.
Default value is: false.
extra File - The directory into which extra, non-deployed files will be written.
Default value is: ${project.build.directory}/extra.
extraJvmArgs String - Extra JVM arguments that are passed to the GWT-Maven generated scripts (for compiler, shell, etc - typically use -Xmx512m here, or -XstartOnFirstThread, etc).

Can be set from command line using '-Dgwt.extraJvmArgs=...', defaults to setting max Heap size to be large enough for most GWT use cases.


Default value is: -Xmx512m.
extraParam boolean 2.1.0-1 add -extra parameter to the compiler command line

Can be set from command line using '-Dgwt.extraParam=true'.


Default value is: false.
failOnError boolean 2.1.0-1 Fail compilation if any input file contains an error.

Can be set from command line using '-Dgwt.compiler.strict=true'.


Default value is: false.
force boolean - Don't try to detect if GWT compilation is up-to-date and can be skipped.

Can be set from command line using '-Dgwt.compiler.force=true'.


Default value is: false.
fragmentCount int 2.5.0-rc1 EXPERIMENTAL: Limits of number of fragments using a code splitter that merges split points.

Can be set from the command line using '-Dgwt.compiler.fragmentCount=n'


Default value is: -1.
gen File - Location on filesystem where GWT will write generated content for review (-gen option to GWT Compiler).

Can be set from command line using '-Dgwt.gen=...'


Default value is: ${project.build.directory}/.generated.
genParam boolean 2.5.0-rc1 Whether to add -gen parameter to the compiler command line

Can be set from command line using '-Dgwt.genParam=false'. Defaults to 'true' for backwards compatibility.


Default value is: true.
gwtSdkFirstInClasspath boolean 2.1.0-1 The forked command line will use gwt sdk jars first in classpath. see issue http://code.google.com/p/google-web-toolkit/issues/detail?id=5290
Default value is: false.
inlineLiteralParameters boolean 2.6.0-rc1 EXPERIMENTAL: Inline literal parameters to shrink function declarations and provide more deadcode elimination possibilities.
Default value is: true.
inplace boolean - Select the place where GWT application is built. In inplace mode, the warSourceDirectory is used to match the same use case of the war:inplace http://maven.apache.org/plugins/maven-war-plugin/inplace-mojo.html goal.
Default value is: false.
jvm String 1.1 Option to specify the jvm (or path to the java executable) to use with the forking scripts. For the default, the jvm will be the same as the one used to run Maven.
localWorkers int - On GWT 1.6+, number of parallel processes used to compile GWT premutations. Defaults to platform available processors number.

Can be unset from command line using '-Dgwt.compiler.localWorkers=n'.


logLevel String - GWT logging level (-logLevel ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL).

Can be set from command line using '-Dgwt.logLevel=...'


Default value is: INFO.
module String - A single GWT module. Shortcut for <modules> or option to specify a single module from command line
modules String[] - The project GWT modules. If not set, the plugin will scan the project for .gwt.xml files.
optimizationLevel int 2.1.0-1 Sets the optimization level used by the compiler. 0=none 9=maximum.

-1 uses the default level of the compiler.

Can be set from command line using '-Dgwt.compiler.optimizationLevel=n'.


Default value is: -1.
optimizeDataflow boolean - EXPERIMENTAL: Analyze and optimize dataflow.
Default value is: true.
ordinalizeEnums boolean 2.6.0-rc1 EXPERIMENTAL: Ordinalize enums to reduce some large strings.
Default value is: true.
persistentunitcache Boolean 2.5.0-rc1 Whether to use the persistent unit cache or not.

Can be set from command line using '-Dgwt.persistentunitcache=...'


persistentunitcachedir File 2.5.0-rc1 The directory where the persistent unit cache will be created if enabled.

Can be set from command line using '-Dgwt.persistentunitcachedir=...'


removeDuplicateFunctions boolean 2.6.0-rc1 EXPERIMENTAL: Removing duplicate functions.

Will interfere with stacktrace deobfuscation and so is only honored when compiler.stackMode is set to strip.


Default value is: true.
saveSource boolean 2.6.0-rc1 Enables saving source code needed by debuggers.
Default value is: false.
saveSourceOutput File 2.6.0-rc2 Overrides where source files useful to debuggers will be written.

Default: saved with extras.


skip boolean - (no description)
Default value is: false.
sourceLevel String 2.6.0-rc1 Specifies Java source level.
Default value is: auto.
style String - GWT JavaScript compiler output style (-style OBF[USCATED], PRETTY, or DETAILED).

Can be set from command line using '-Dgwt.style=...'


Default value is: OBF.
timeOut int - Forked process execution timeOut. Usefull to avoid maven to hang in continuous integration server.
validateOnly boolean - Validate all source code, but do not compile.

Can be set from command line using '-Dgwt.validateOnly=true'.


Default value is: false.
warSourceDirectory File - Location of the web application static resources (same as maven-war-plugin parameter)
Default value is: ${basedir}/src/main/webapp.
webappDirectory File - Location on filesystem where GWT will write output files (-out option to GWTCompiler).
Default value is: ${project.build.directory}/${project.build.finalName}.
workDir File - The compiler's working directory for internal use (must be writeable; defaults to a system temp dir)

Parameter Details

checkAssertions:

Whether or not to enable assertions in generated scripts (-checkAssertions).
  • Type: boolean
  • Required: No
  • Default: false

closureCompiler:

EXPERIMENTAL: Compile output Javascript with the Closure compiler for even further optimizations.

Can be set from the command line using '-Dgwt.compiler.enableClosureCompiler=true'

  • Type: boolean
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.enableClosureCompiler}
  • Default: false

clusterFunctions:

EXPERIMENTAL: Cluster similar functions in the output to improve compression.
  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.clusterFunctions}
  • Default: true

compileReport:

Compile a report that tells the "Story of Your Compile".

Can be set from command line using '-Dgwt.compiler.compileReport=true'.

  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.compiler.compileReport}
  • Default: false

compileSourcesArtifacts:

Artifacts to be included as source-jars in GWTCompiler Classpath. Removes the restriction that source code must be bundled inside of the final JAR when dealing with external utility libraries not designed exclusivelly for GWT. The plugin will download the source.jar if necessary. This option is a workaround to avoid packaging sources inside the same JAR when splitting and application into modules. A smaller JAR can then be used on server classpath and distributed without sources (that may not be desirable).
  • Type: java.lang.String[]
  • Required: No

compilerMetrics:

EXPERIMENTAL: Gather compiler metrics.

Can be set from the command line using '-Dgwt.compiler.compilerMetrics=true'

  • Type: boolean
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.compilerMetrics}
  • Default: false

deploy:

The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the webappDirectory directory/jar, and may be the same as the extra directory/jar)
  • Type: java.io.File
  • Since: 2.3.0-1
  • Required: No

detailedSoyc:

EXPERIMENTAL: Emit extra, detailed compile-report information in the "Story Of Your Compile" at the expense of compile time.

Can be set from command line using '-Dgwt.compiler.soycDetailed=true'.

  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.compiler.soycDetailed}
  • Default: false

disableAggressiveOptimization:

Deprecated. since 2.6.0-rc1
EXPERIMENTAL: add -XdisableAggressiveOptimization parameter to the compiler command line

Can be set from the command line using '-Dgwt.compiler.disableAggressiveOptimization=true'

  • Type: boolean
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.disableAggressiveOptimization}
  • Default: false

disableCastChecking:

EXPERIMENTAL: Disables run-time checking of cast operations.

Can be set from command line using '-Dgwt.disableCastChecking=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.disableCastChecking}
  • Default: false

disableClassMetadata:

EXPERIMENTAL: Disables some java.lang.Class methods (e.g. getName()).

Can be set from command line using '-Dgwt.disableClassMetadata=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.disableClassMetadata}
  • Default: false

disableRunAsync:

EXPERIMENTAL: Disables code-splitting.

Can be set from command line using '-Dgwt.disableRunAsync=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.disableRunAsync}
  • Default: false

draftCompile:

Enable faster, but less-optimized, compilations.

Can be set from command line using '-Dgwt.draftCompile=true'.

This is equivalent to '-Dgwt.compiler.optimizationLevel=0 -Dgwt.compiler.disableAggressiveOptimization=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.draftCompile}
  • Default: false

enforceStrictResources:

EXPERIMENTAL: Avoid adding implicit dependencies on "client" and "public" for modules that don't define any dependencies.
  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.enforceStrictResources}
  • Default: false

extra:

The directory into which extra, non-deployed files will be written.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/extra

extraJvmArgs:

Extra JVM arguments that are passed to the GWT-Maven generated scripts (for compiler, shell, etc - typically use -Xmx512m here, or -XstartOnFirstThread, etc).

Can be set from command line using '-Dgwt.extraJvmArgs=...', defaults to setting max Heap size to be large enough for most GWT use cases.

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.extraJvmArgs}
  • Default: -Xmx512m

extraParam:

add -extra parameter to the compiler command line

Can be set from command line using '-Dgwt.extraParam=true'.

  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.extraParam}
  • Default: false

failOnError:

Fail compilation if any input file contains an error.

Can be set from command line using '-Dgwt.compiler.strict=true'.

  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.compiler.strict}
  • Default: false

force:

Don't try to detect if GWT compilation is up-to-date and can be skipped.

Can be set from command line using '-Dgwt.compiler.force=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.compiler.force}
  • Default: false

fragmentCount:

EXPERIMENTAL: Limits of number of fragments using a code splitter that merges split points.

Can be set from the command line using '-Dgwt.compiler.fragmentCount=n'

  • Type: int
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.fragmentCount}
  • Default: -1

gen:

Location on filesystem where GWT will write generated content for review (-gen option to GWT Compiler).

Can be set from command line using '-Dgwt.gen=...'

  • Type: java.io.File
  • Required: No
  • Expression: ${gwt.gen}
  • Default: ${project.build.directory}/.generated

genParam:

Whether to add -gen parameter to the compiler command line

Can be set from command line using '-Dgwt.genParam=false'. Defaults to 'true' for backwards compatibility.

  • Type: boolean
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.genParam}
  • Default: true

generateDirectory:

Folder where generated-source will be created (automatically added to compile classpath).
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/generated-sources/gwt

gwtSdkFirstInClasspath:

The forked command line will use gwt sdk jars first in classpath. see issue http://code.google.com/p/google-web-toolkit/issues/detail?id=5290
  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.gwtSdkFirstInClasspath}
  • Default: false

inlineLiteralParameters:

EXPERIMENTAL: Inline literal parameters to shrink function declarations and provide more deadcode elimination possibilities.
  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.inlineLiteralParameters}
  • Default: true

inplace:

Select the place where GWT application is built. In inplace mode, the warSourceDirectory is used to match the same use case of the war:inplace http://maven.apache.org/plugins/maven-war-plugin/inplace-mojo.html goal.
  • Type: boolean
  • Required: No
  • Expression: ${gwt.inplace}
  • Default: false

jvm:

Option to specify the jvm (or path to the java executable) to use with the forking scripts. For the default, the jvm will be the same as the one used to run Maven.
  • Type: java.lang.String
  • Since: 1.1
  • Required: No
  • Expression: ${gwt.jvm}

localWorkers:

On GWT 1.6+, number of parallel processes used to compile GWT premutations. Defaults to platform available processors number.

Can be unset from command line using '-Dgwt.compiler.localWorkers=n'.

  • Type: int
  • Required: No
  • Expression: ${gwt.compiler.localWorkers}

logLevel:

GWT logging level (-logLevel ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL).

Can be set from command line using '-Dgwt.logLevel=...'

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.logLevel}
  • Default: INFO

module:

A single GWT module. Shortcut for <modules> or option to specify a single module from command line
  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.module}

modules:

The project GWT modules. If not set, the plugin will scan the project for .gwt.xml files.
  • Type: java.lang.String[]
  • Required: No

optimizationLevel:

Sets the optimization level used by the compiler. 0=none 9=maximum.

-1 uses the default level of the compiler.

Can be set from command line using '-Dgwt.compiler.optimizationLevel=n'.

  • Type: int
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.compiler.optimizationLevel}
  • Default: -1

optimizeDataflow:

EXPERIMENTAL: Analyze and optimize dataflow.
  • Type: boolean
  • Required: No
  • Expression: ${gwt.compiler.optimizeDataflow}
  • Default: true

ordinalizeEnums:

EXPERIMENTAL: Ordinalize enums to reduce some large strings.
  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.ordinalizeEnums}
  • Default: true

persistentunitcache:

Whether to use the persistent unit cache or not.

Can be set from command line using '-Dgwt.persistentunitcache=...'

  • Type: java.lang.Boolean
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.persistentunitcache}

persistentunitcachedir:

The directory where the persistent unit cache will be created if enabled.

Can be set from command line using '-Dgwt.persistentunitcachedir=...'

  • Type: java.io.File
  • Since: 2.5.0-rc1
  • Required: No
  • Expression: ${gwt.persistentunitcachedir}

removeDuplicateFunctions:

EXPERIMENTAL: Removing duplicate functions.

Will interfere with stacktrace deobfuscation and so is only honored when compiler.stackMode is set to strip.

  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.compiler.removeDuplicateFunctions}
  • Default: true

saveSource:

Enables saving source code needed by debuggers.
  • Type: boolean
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${gwt.saveSource}
  • Default: false

saveSourceOutput:

Overrides where source files useful to debuggers will be written.

Default: saved with extras.

  • Type: java.io.File
  • Since: 2.6.0-rc2
  • Required: No

skip:

(no description)
  • Type: boolean
  • Required: No
  • Expression: ${gwt.compiler.skip}
  • Default: false

sourceLevel:

Specifies Java source level.
  • Type: java.lang.String
  • Since: 2.6.0-rc1
  • Required: No
  • Expression: ${maven.compiler.source}
  • Default: auto

style:

GWT JavaScript compiler output style (-style OBF[USCATED], PRETTY, or DETAILED).

Can be set from command line using '-Dgwt.style=...'

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.style}
  • Default: OBF

timeOut:

Forked process execution timeOut. Usefull to avoid maven to hang in continuous integration server.
  • Type: int
  • Required: No

validateOnly:

Validate all source code, but do not compile.

Can be set from command line using '-Dgwt.validateOnly=true'.

  • Type: boolean
  • Required: No
  • Expression: ${gwt.validateOnly}
  • Default: false

warSourceDirectory:

Location of the web application static resources (same as maven-war-plugin parameter)
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/webapp

webappDirectory:

Location on filesystem where GWT will write output files (-out option to GWTCompiler).
  • Type: java.io.File
  • Required: No
  • Expression: ${gwt.war}
  • Default: ${project.build.directory}/${project.build.finalName}

workDir:

The compiler's working directory for internal use (must be writeable; defaults to a system temp dir)
  • Type: java.io.File
  • Required: No