I have a GWT project. Client code is located in the "client" dir. I want to attach an external java classes (mainly plain POJO DTO classes) that are in external directory. How to configure the gwt.xml file?
I get errors of this kind:
[ERROR] Errors in 'file:/C:/development/projects/CodeSpaces/LocateMe/LocateMeWeb/src/com/dominolog/locateme/client/LocateMeWeb.java' [ERROR] Line 56: No source code is available for type com.dominolog.locateme.model.dto.LocationInfo; did you forget to inherit a required module?
If you have the java source files you just need to add the directory to you .gwt.xml file. For instance if you had a subdirectory called shared you would add the following line:
<source path='shared'/>
The folder called shared would have to be one level under your main package. So if you project .gwt.xml file is at com.yourdomain.project the shared folder.package would be com.yourdomain.project.shared. Refer to the Source Path section at http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules
If you dont have the source and only have the classes you have to import a module as Hilbrand has stated.
Here is another solution that works http://www.gordonizer.com/2012/01/referencing-third-party-library-source.html .
I short (just in case this link also gets invalid some day):
com.foo.bar.bat
.com.foo.bar
(without the subpackage bat
).In your new package you create a new GWT module file Foo.gwt.xml
with content like
<module>
<source path="bat" />
</module>
(I have ommitted the XML header for sake of readability)
Finally add this new module to your main GWT module using the inherit
tag:
<inherits name="com.foo.bar.Foo"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With