maven gwt module depends on a external jar

186 views
Skip to first unread message

tong123123

unread,
May 21, 2012, 4:57:49 AM5/21/12
to google-we...@googlegroups.com
I have a mavenize gwt module depends on a jar(this jar is simple jar, no gwt related).
the project name of the jar is als-admin-viewer-core with maven coordinate
<groupId>hk.gov.ehr.service.tch.als</groupId>
<artifactId>als-admin-viewer-core</artifactId>
<version>1.0.0</version>
<package>jar</package>

and the mavenize gwt module name is
als-admin-viewer-webapp
and in its .pom.xml, I already add the dependency as follow:
<dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>
</dependency>

then I run mvn clean install of the jar project first ( als-admin-viewer-core), then I run mvn clean install for mavenize gwt project "als-admin-viewer-webapp",
but then the following error prompt:
error:
Computing all possible rebind results for 'hk.gov.ehr.service.tch.als.admin.viewer.client.SearchService'
[INFO]          Rebinding hk.gov.ehr.service.tch.als.admin.viewer.client.SearchService
[INFO]             Checking rule <generate-with class='com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator'/>
[INFO]                [ERROR] Errors in 'file:/D:/workspace/als-admin-viewer-webapp/src/main/java/hk/gov/ehr/service/tch/als/admin/viewer/client/SearchService.java'
[INFO]                   [ERROR] Line 16: No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria; did you forget to inherit a required module?
[INFO]                   [ERROR] Line 17: No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.Log; did you forget to inherit a required module?
there is no error in eclipse IDE at design time, and I already add the dependency of the jar in als-admin-viewer-webapp's .pom.xml, why it still cannot find the class "hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria" in " als-admin-viewer-core"?
is modification of .gwt.xml needed? I see the developer guide of gwt, and it only mention add <inherit> element to other .gwt.xml module, no need to add any jar in <inherit> element in .gwt.xml !!




Thomas Broyer

unread,
May 21, 2012, 5:20:16 AM5/21/12
to google-we...@googlegroups.com

tong123123

unread,
May 21, 2012, 6:31:57 AM5/21/12
to google-we...@googlegroups.com
oh, the pom.xml in the link is quite complex, but in my als-admin-viewer-core pom.xml, I already write
<package>jar</package>
and I found under  als-admin-viewer-core/target, the als-admin-viewer-core-1.0.0.jar is already created, so what I miss is
adding als-admin-viewer-core-1.0.0.jar as a dependency in als-admin-viewer-webapp.pom.xml?

sorry as the task is already delayed and anyway, thanks for your reply.

Thomas Broyer

unread,
May 21, 2012, 6:43:55 AM5/21/12
to google-we...@googlegroups.com


On Monday, May 21, 2012 12:31:57 PM UTC+2, tong123123 wrote:
oh, the pom.xml in the link is quite complex, but in my als-admin-viewer-core pom.xml, I already write
<package>jar</package>
and I found under  als-admin-viewer-core/target, the als-admin-viewer-core-1.0.0.jar is already created, so what I miss is
adding als-admin-viewer-core-1.0.0.jar as a dependency in als-admin-viewer-webapp.pom.xml?

That's already the case (from what you said earlier). You need to call the source:jar-no-fork goal in your *-core project (it'll generate a an *-core-1.0.0-sources.jar in target) and add a dependency on that sources JAR (in addition to the "binary" JAR you already have: one is for javac –and Eclipse–, the other for GWT):
<dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>
</dependency>
<dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>
    <classifier>sources</classifier>
</dependency>
Message has been deleted

Kei Kei

unread,
May 22, 2012, 12:19:38 AM5/22/12
to google-we...@googlegroups.com
I have called the source:jar-no-fork goal in my *-core.pom.xml project (and als-admin-viewer-core-1.0.0-
sources.jar is generated), and I already add the dependency on the webapps pom.xml

<dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>
    <classifier>sources</classifier>
</dependency>
in both the <dependencies> section and <build>...<plugin>..<artifactId>gwt-maven-plugin</artifactId> <dependencies> section,but the error message is the same

No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria; did you forget to inherit a required module?
I have checked the als-admin-viewer-core-1.0.0-sources.jar, and the LogSearchCriteria.java is definitely in the sources.jar, it seems webapp module still cannot add the dependency of the source...anything I am missing?

thanks.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/cBHTSC__TjMJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

tong123123

unread,
May 22, 2012, 3:18:06 AM5/22/12
to google-we...@googlegroups.com
I even try to add
<compileSourcesArtifacts>
  <artifact>hk.gov.ehr.service.tch.als:als-admin-viewer-core</artifact>  <!-- groupId:artifactId -->
</compileSourcesArtifacts>
in <configuration> section of gwt-maven-plugin, but it still does not help!!
I see this method in http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html#Using_general_purpose_JARs_as_GWT_library
but is it need to create a ''gwt.xml'' module file in core project? this is totally ridiculous as it is not a gwt module!!!!

Thomas Broyer

unread,
May 22, 2012, 4:27:38 AM5/22/12
to google-we...@googlegroups.com


On Tuesday, May 22, 2012 9:18:06 AM UTC+2, tong123123 wrote:
I even try to add
<compileSourcesArtifacts>
  <artifact>hk.gov.ehr.service.tch.als:als-admin-viewer-core</artifact>  <!-- groupId:artifactId -->
</compileSourcesArtifacts>
in <configuration> section of gwt-maven-plugin, but it still does not help!!
I see this method in http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html#Using_general_purpose_JARs_as_GWT_library
but is it need to create a ''gwt.xml'' module file in core project? this is totally ridiculous as it is not a gwt module!!!!

Because GWT loads everything from the classpath, it doesn't matter where the GWT module is located "physically", just that it's in the "right" package.

tong123123

unread,
May 24, 2012, 1:59:33 AM5/24/12
to google-we...@googlegroups.com
how to run my mavenize core project (which is called by webapp project written in gwt) in eclipse debug mode so I can run it step by step?
I do not know where to ask, I try to subscribe
http://dev.eclipse.org/mhonarc/lists/m2e-users/
and send the question to that email address, but I cannot see my question in
http://dev.eclipse.org/mhonarc/lists/m2e-users/

Reply all
Reply to author
Forward
0 new messages