How to compile a module without EntryPoint?

I have a utility module for GWT that does not have a UI (hence, there is no class that inherits from com.google.gwt.core.client.EntryPoint . When I try to compile this module with GWT 1.7.1, I get this error:

 [ERROR] Module has no entry points defined 

How to get rid of this error? Should I define a dummy entry point? How did Google build its own service modules?

+6
gwt entry-point
source share
5 answers

I am using the gwt-maven-plugin Maven2 gwt-maven-plugin to compile my code. I migrated the code from the old version of the maven-googlewebtoolkit2-plugin . For the old plugin, I had to specify which modules were such entry points:

  <compileTargets> <param>com.project.module.Module</param> </compileTargets> 

For the new plugin, he

  <module>com.project.module.Module</module> 

Since the plugin could not find which modules to compile, it searches for "* .gwt.xml" and compiles them all into "UI modules" (which must have an entry point).

0
source share

Jars utilities should not compile GWT.

If you just want to reuse this as a library in other GWT applications, you just need to jar the .class and .java files in one jar and make sure you have .gwt.xml which says where the client source is. If you follow the conventions (client classes on the client), then you can do it simply, otherwise you need to specify a tag for the client package

Then make sure you inherit this .gwt.xml in projects where you want to compile the entry point.

+5
source share

No, you do not need EntryPoint. Here is an example of one of my modules that does not have one:

 <?xml version="1.0" encoding="UTF-8"?> <module> <source path="grid" /> <inherits name="com.google.gwt.user.User"/> </module> 

Short answer: you do not compile code into modules. GWT just needs them as source code. When you compile your main module (one that has an entry point), it uses the source from any other modules that you inherited in your .gwt.xml file to compile the entire project.

+3
source share

We have a utility module that builds and processes some common user interface elements and a bunch of common javascript / json tasks.

It looks like we did (also migrated from the totsp plugin to the codehaus plugin somewhere along the line) to include the entry point into the utility module; it was just empty. (It includes the comment "Intentional no-op").

Then pom just refers to the thing as a dependency.

0
source share

If you use the eclipse GWT plugin, simply remove the module without EntryPoint from the list of modules that appears immediately before compilation.

0
source share

All Articles