简体   繁体   中英

Why does GWT compile errors won't break the maven build?

I'm building a GWT project in maven using gwt-maven-plugin.

Recently I noticed an error on a class, where some server code was called on a client class. At first I thought that something was wrong with the gwt compilation (not including this class). But then I notice that it was compiling that class and it was throwing the error on info log level.

[INFO]    Tracing compile failure path for type 'com.mycompany.shared.IElement'
[INFO]       Errors in 'jar:file:/Users/myuser/.m2/repository/com/mycompany/package/package-java/1.0.0-SNAPSHOT/package-java-1.0.0-SNAPSHOT-sources.jar!/com/mycompany/shared/IElement.java'
[INFO]          Line 45: No source code is available for type com.mycompany.test.Tester; did you forget to inherit a required module?

Why this is only a info log? Why this does not breaks the build? Can I force the build to break upon this kind of errors?

Yes you can, and in fact you should! Its even likely that this option will be on by default in the future, as these sorts of 'recoverable' errors cause performance issues in the compiler as it keeps recovering and working around the missing code.

Using the maven plugin, you can simply set this flag to true. From http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html#failOnError ,

failOnError:

Fail compilation if any input file contains an error. Can be set from command line using ' -Dgwt.compiler.strict=true '.

In your plugin's <configuration> block, this looks like

<failOnError>true</failOnError>

(This used to be called <strict> , and in some of my own pom files, still lives that way...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM