Problem using classes from external modules

156 views
Skip to first unread message

Julian

unread,
Oct 7, 2011, 10:40:55 AM10/7/11
to google-we...@googlegroups.com
Hi

I am trying to get my GWT application to work with an existing project consisting of several maven modules. Currently I'm struggling trying to use an enum from one of the existing maven modules, in my GWT client-side code. The way I'm tying to do it is by creating an extra GWT module where the enum is located.


EXISTING MAVEN MODULE: ExtraModule

src/com/app/extra/ExtraModule.gwt.xml
src/com/app/extra/data/MyEnum.java

<module rename-to="ExtraModule">
<source path="data">
<include name="MyEnum.java" />
</source>
</module>


NEW GWT MAVEN MODULE: MainModule

src/com/app/main/MainModule.gwt.xml
src/com/app/main/client/XAdmin.java

<module rename-to='MainModule'>
<inherits name="ExtraModule" />
<entry-point class='com.app.main.client.XAdmin' />
</module>


I managed to make the source from ExtraModule available in MainModule by using the Build Helper maven-plugin:

from my pom.xml

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>/path/to/project/src/com/app/extra/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>


This seems to work just fine, as ExtraModule was found and skipped (as there is no entry-point). The enum, MyEnum.java, however, is nowhere to be found. What am I doing wrong here? 


The stacktracke from running mvn clean install

[INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ app-web ---
[INFO] auto discovered modules [ExtraModule, com.app.main.MainModule]
[INFO] ExtraModule has no EntryPoint - compilation skipped
[INFO] Compiling com.app.main.MainModule
[INFO]    Validating newly compiled units
[INFO]       Ignored 2 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Finding entry point classes
[INFO]       [ERROR] Errors in 'file:/Users/chuck.norris/workspace/app-web/src/main/java/com/app/main/shared/dto/SomeProxy.java'
[INFO]          [ERROR] Line 81: No source code is available for type com.app.extra.data.MyEnum; did you forget to inherit a required module?
Reply all
Reply to author
Forward
0 new messages