1

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 ...
Lonzak
  • 9,334
  • 5
  • 57
  • 88

1 Answers1

2

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.

Ignacio Baca
  • 1,538
  • 14
  • 18
  • Thanks for the infos! But it doesn't seem to be fixed in a newer version, does it? Still strange, since if I execute it from commandline it is working. But from what I see it shouldn't... – Lonzak Mar 04 '19 at 15:50
  • but are you executing the mvn goal? and, is there some maven profile? or can you show the whole pom.xml configuration? – Ignacio Baca Mar 05 '19 at 08:07