Closed freddyboucher closed 8 years ago
I think you'll need to add the packages that contain client side code (so shared & client) to the gwt module definition here: https://github.com/freddyboucher/webapp/blob/master/webapp-client/src/main/module.gwt.xml
so replace <source path="" />
with <source path="client" />
and <source path="shared" />
The problem is that you have your module in com.test.client
(with <source path=""/>
) so com.test.shared
is not in the GWT source path.
To follow GWT's general conventions, you'd put your module in com.test
(i.e. <moduleName>com.test.App</moduleName>
). You shouldn't have to exclude com.test.server
from GWT's source path, as it shouldn't be present in the classpath, but you may want to change the <source path="" />
to:
<source path="client" />
<source path="shared" />
(or just remove the <source path="" />
, and the gwt:generate-module
mojo will automatically generate those 2 lines along with a <super-source path="super" />
).
So @kaefert is not wrong, but that wouldn't change anything alone, as the root of the problem is that you changed <moduleName>
.
diff --git a/webapp-client/pom.xml b/webapp-client/pom.xml
index 69e23fd..246d403 100644
--- a/webapp-client/pom.xml
+++ b/webapp-client/pom.xml
@@ -43,7 +43,7 @@
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
- <moduleName>com.test.client.App</moduleName>
+ <moduleName>com.test.App</moduleName>
<moduleShortName>webapp</moduleShortName>
</configuration>
</plugin>
diff --git a/webapp-client/src/main/module.gwt.xml b/webapp-client/src/main/module.gwt.xml
index 9bb19be..4253e11 100644
--- a/webapp-client/src/main/module.gwt.xml
+++ b/webapp-client/src/main/module.gwt.xml
@@ -3,7 +3,8 @@
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.user.theme.clean.Clean" />
- <source path="" />
+ <source path="client" />
+ <source path="shared" />
<entry-point class="com.test.client.App" />
You were right, I just moved the EntryPoint under com.test https://github.com/freddyboucher/webapp/commit/3ff99f3d0ab57ead3ef984b745ad045f3a5c08ee Everything works fine! Thanks @kaefert @tbroyer
No need to move the EntryPoint
; only the module needed to move (either that or create another module in com.test.shared
with <source path="" />
that the module under com.test.client
<inherits/>
)
@tbroyer Perfect it works with my EntryPoint under /client package as you said! https://github.com/freddyboucher/webapp/commit/5adf0748b3e09fac4d9b7e6064966f3e57f4903f
PS: I'm going to open another issue because mvn jetty:start -Denv=dev
and it's probably not related with this one.
Thanks
Hi @tbroyer I'm refactoring my app to use your maven plugin but I'd like to keep client/shared and server in my package name (in addition of having them in a different maven module) instead of using the same package name for all.
But when I do it and execute mvn gwt:codeserver -pl webapp-client -am, I get:
I setup a small Github project to show you what I did: https://github.com/freddyboucher/webapp/commit/f5ead4458026f6349f18a9692bdf13718c64e375
How can I achieve that? Thanks