Lonzak
Lonzak

Reputation: 9816

Different behavior of gwt-maven-plugin in IDE and commandline

I am using the gwt-maven-plugin and since recently I got strange errors in my IDE (eclipse oxygen). After researching it I realize that the gwt-maven-plugin is behaving differently when run in eclipse or on commandline. On commandline everything is ok and the gwt:css creates an interface with the correct visisbility (public). But when I run it in eclipse the public is missing and thus I get all the errors in eclipse since the classes can not access the interface anymore. I am using gwt 2.6.1, JDK 1.8.0 (but build itself is with 1.6) and maven 3.5.2.

Any ideas what is causing this?

<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>gwt-maven-plugin</artifactId>
 <executions>
  <execution>
   <goals>
    <goal>compile</goal>
    <goal>test</goal>
    <goal>css</goal>
    <goal>generateAsync</goal>
   <goals>
  </execution>
</executions>
<configuration>
 <skip>${gwt.skipcompile.config}</skip>
 <inplace>true</inplace>
 <module>${gwt.module.config}</module>
 <runTarget>Config.html</runTarget>
 <hostedWebapp>${webappDirectory}</hostedWebapp>
 <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
 <compileReport>true</compileReport>
 <cssFiles>
  <cssFile>MyCss.css</cssFile>
 </cssFiles>

//And the code is generated like this (eclipse):
interface MyCss extends CssResource ...

//in command line
public interface MyCss extends CssResource ...

Upvotes: 1

Views: 194

Answers (1)

Ignacio Baca
Ignacio Baca

Reputation: 1578

The gwt-maven-plugin delegates to GWT InterfaceGenerator and it doesn't add the public modifier. You can see the git-log and confirm that this has been always the case (already reported sometimes). So, you cannot be executing the plugin goal from the command line, you should be using something different. For example, you might have a script that adds the public modifier using awk (or something similar), and this is not executed from eclipse.

Side note: You really should upgrade GWT and gwt-maven-plugin.

Upvotes: 2

Related Questions