Will the gwt-lib projects work with incremental compile or will I have to stop the dev mode, rebuild the library, and run again?
Each one of those projects uses
<packaging>gwt-lib</packaging>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-2</version>
<extensions>true</extensions>
<configuration>
<moduleName>gwt.library.core.LibraryClient</moduleName>
<moduleShortName>LibraryClient</moduleShortName>
</configuration>
</plugin>
</plugins>
</build>
Of course the module name is different for the shared and server projects. So when I maven install the parent "library-core" project it will compile all 3 sub projects into their respective jars.
Now I created a "base" project that depends on the library. This project was created with the modular-webapp archetype. In my base-client I depend on the library-core-client and my base-server depends on the library-core-server.
For example in the base-client I have this:
<dependency>
<groupId>gwt.library</groupId>
<artifactId>library-core-client</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>gwt-lib</type>
</dependency>
So when I run superdev like this:
gwt:codeserver -pl *-client -am
tomcat7:run -pl *-server -am -Denv=dev
it all works, the dependencies play nice together, the only problem is if I change code in the library-core-client and refresh the browser, it does not detect the change.
Am I missing something or is there a better way to structure the projects so they will work correctly?
Thank you so much,
Will
That is great news! I hope I can get your much appreciated assistance to help me figure out what I am doing wrong, because as of right now it isn't working for me. I am sure there is something I haven't configured properly so let me show you what I have.I am using the modular-webapp for the project with gwt-app. Similarly I wanted to have a library project that is divided by client, shared, and server projects.So my library set up is as follows:Each one of those projects uses
<packaging>gwt-lib</packaging>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-2</version>
<extensions>true</extensions>
<configuration>
<moduleName>gwt.library.core.LibraryClient</moduleName>
<moduleShortName>LibraryClient</moduleShortName>
</configuration>
</plugin>
</plugins>
</build>
Of course the module name is different for the shared and server projects. So when I maven install the parent "library-core" project it will compile all 3 sub projects into their respective jars.
I think I figured something out. In the "base" project, in the parent pom, I only defined the three modules in that project like this:<modules><module>base-client</module><module>base-shared</module><module>base-server</module></modules>but I changed it to add the client library like this:<modules><module>base-client</module><module>../library-core/library-core-client</module><module>base-shared</module><module>base-server</module></modules>and now the incremental compile works when I make changes to the library client.Is this the correct/best way to do this?
So I found a solution, but I am a little unclear why it works and what is the best practice. Before when it wasn't working I had this dependency in my server project:<dependency><groupId>com.gwt.library</groupId><artifactId>library-core-server</artifactId><version>1.0.0-SNAPSHOT</version><type>gwt-lib</type></dependency>When I removed the <type>gwt-lib</type> and rebuilt, it put the library-core-server.jar in the web-inf/lib directory which was put in the war and that made it work when I deployed the war.Am I incorrectly using the <type>gwt-lib</type>?
Is there a better way to make sure that jar gets put in the war?
Will anything not work correctly if I don't put in the <type>gwt-lib</type>?
So I figured out that if I do a maven install a war is generated in the server project, however my servlet classes from the libraries were not copied into the war. Still looking into that...