gwt:compile

Full name:

org.codehaus.mojo:gwt-maven-plugin:2.5.1: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.
  • 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
compileReport boolean 2.1.0-1 add -compileReport parameter to the compiler command line

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: add -XcompilerMetrics parameter to the compiler command line

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)
disableAggressiveOptimization boolean 2.5.0-rc1 EXPERIMENTAL: add -XdisableAggressiveOptimization parameter to the compiler command line

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


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.
enableAssertions boolean - Whether or not to enable assertions in generated scripts (-ea).
Default value is: false.
enableClosureCompiler boolean 2.5.0-rc1 EXPERIMENTAL: add -XenableClosureCompiler parameter to the compiler command line

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


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.
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: add -XfragmentCount parameter to the compiler command line

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.
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 add -optimize parameter to the compiler command line the value must be between 0 and 9 by default -1 so no arg to the compiler

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


Default value is: -1.
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=...'


skip boolean - (no description)
Default value is: false.
soycDetailed boolean 2.1.0-1 add -XsoycDetailed parameter to the compiler command line

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


Default value is: false.
strict boolean 2.1.0-1 add -strict parameter to the compiler command line

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


Default value is: false.
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.
treeLogger boolean - Logs output in a graphical tree view.

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


Default value is: false.
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 temp directory is used for temporary compiled files (defaults is system temp directory).

Parameter Details

compileReport:

add -compileReport parameter to the compiler command line

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: add -XcompilerMetrics parameter to the compiler command line

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

disableAggressiveOptimization:

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

enableAssertions:

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

enableClosureCompiler:

EXPERIMENTAL: add -XenableClosureCompiler parameter to the compiler command line

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

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

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: add -XfragmentCount parameter to the compiler command line

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

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:

add -optimize parameter to the compiler command line the value must be between 0 and 9 by default -1 so no arg to 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

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}

skip:

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

soycDetailed:

add -XsoycDetailed parameter to the compiler command line

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

strict:

add -strict parameter to the compiler command line

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

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

treeLogger:

Logs output in a graphical tree view.

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

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

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 temp directory is used for temporary compiled files (defaults is system temp directory).
  • Type: java.io.File
  • Required: No