2

I've set up a new GWT project in NetBeans 6.9 and created multiple GWT modules I've tried adding them all in the gwt.properties file as follows:

  *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1 com.company.MyModule2 com.company.MyModule3*

I'm getting an error at compilation time saying that it doesn't find the second module. Now, i can compile just fine only ONE module. Doesn't matter which one. Is it something i'm doing wrong or it's a bug in gwt/nbgwt ?

I also tried this:

 *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1
  gwt.module=com.company.MyModule2
  gwt.module=com.company.MyModule3*

In this case only the last module in the list gets compiled.

Lucian
  • 101
  • 2
  • 12

1 Answers1

0

You need to create a gwt.xml file per module.

Then you can compile all of them with an ANT Task

<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
            <pathelement location="src"/>
            <path refid="project.class.path"/>
        </classpath>
        <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
        <arg value="${myModuleName}"/>
    </java>
</target>
Carlos Tasada
  • 4,438
  • 1
  • 23
  • 26
  • I've created one gwt.xml file per module and they are called Module1.gwt.xml, Module2.gwt.xml etc and they all are in the package com.company – Lucian Dec 01 '10 at 15:36
  • @Lucian: Are you building using NetBeans or the ANT task? What's the output of the build? – Carlos Tasada Dec 01 '10 at 16:46
  • I'm building with Netbeans and i thought NetBeans is using ant to build everything. I don't know much about build tools. Maybe it's using a build tool specific for GWT. My project has a file called gwt.properties containing settings for the gwt compiler. In this file i tried adding the instructions. Now, the error comes from build-gwt.xml and it says that my module does not exist. – Lucian Dec 01 '10 at 17:07
  • GWT Plugin for Netbeans is officially supported. You're right that Netbeans uses ant for building, but I think you're mixing too many things. I would recommend you to repeat your tests with Eclipse and once you known that works fine in a supported environment, then you can try moving back to Netbeans if you feel more comfortable there. Also, why do you need 3 modules? – Carlos Tasada Dec 01 '10 at 18:13
  • The reason i'm trying NetBeans is because i'm trying to combine jsp files to generate content on server side and then manipulate it with GWT client side code. This way my pages will be indexed by search engines. Now, in eclipse i can't get the server (jetty in my case) to serve my jsp files. I didn't have any problems compiling multiple modules in eclipse – Lucian Dec 01 '10 at 19:08