Kathir
Kathir

Reputation: 6196

GWT Multi Module Project with Maven

I have a multi-module GWT project with the following approach, but I am having trouble running it in dev mode.

Here is the structure of the POM files.

Parent POM

<project>
    <groupId>com.mycmp</groupId>
    <artifactId>com.mycmp.xt</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <modules>
        <module>../com.mycmp.xt.dm</module>
        <module>../com.mycmp.xt.pc</module>
        <module>../com.mycmp.xt.re</module>
        <module>../com.mycmp.xt.rev</module>
        <module>../com.mycmp.xt.webapp</module>
        <module>../com.mycmp.xt.services</module>
    </modules>
    <dependencies>
    </dependencies>
    <build>
        <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>2.5.1</version>
        </plugin>
    </build>
</project>

From the modules,

I am thinking about the following questions:

Upvotes: 1

Views: 2431

Answers (1)

Kaszaq
Kaszaq

Reputation: 1077

To the third question: When making modules keep in mind that resources you provide from different modules are not attached from the files inside your modules, but from their jar's. So when you use code in your gui application from another module and you change code inside that module you will need to recompile that module, as dev mode will compile on the run code from jar's and from source code of the project you have started using dev mode.

For instance: you have parent module named A. This parent module contains two modules B and C. In C you have some common classes. In B you have implemented the entire gui with entry point. Also in pom of module B you have added gwt-maven-plugin in build section. When you start your project from module B in Dev mode any changes you make inside your B module will be reflected on webpage when you refresh your webpage. However if you modify any classes inside module C, those changes will not be visible until you restart the dev mode and after you rebuilt module C. This is because refreshing the webpage does not rebuilt the modules that are dependencies.

However I do not know how dev mode will behave when you would start it from parent pom after u specify module in the configuration tag of gwt-maven-plugin.

Upvotes: 1

Related Questions