Adding Java modules as dependencies in GWT Maven project with plugin 2.7.0

87 views
Skip to first unread message

Sai Manoj Athota

unread,
Jun 24, 2016, 9:25:35 AM6/24/16
to GWT Users
Hi Team,

We have 2 maven projects where the 1st is pure java module called "common" which is used by some other pure java maven projects also.
And the 2nd is Gwt maven module. I want to include the 1st module in gwt module as maven dependency.  Can you please provide the steps to do it. I tried as below,

Included 1st project as dependency in 2nd project's pom as below,

<dependency>
<groupid>com.ex<groupid>
<artifactid>example</artifactid>
<version>0.0.1-SNAPSHOT</version>
</dependency>

But getting the error as below,

 No source code is available for type com.ex.Example did you forget to inherit a required module?

Where com.ex.Example is the Java class from 1st maven module.

Kindly assist me to achieve this.

Thanks
Sai

Jens

unread,
Jun 24, 2016, 9:42:46 AM6/24/16
to GWT Users
GWT also needs source files so you need to add a second dependency to the source artifact using <classifier>sources</classifier>.

You also need a GWT module for your common project and inherit it in your 2nd project's GWT module. Otherwise GWT compiler will not see the code of your common project. The common.gwt.xml file does not have to be bundled in the common artifact, it just needs to be on classpath (e.g. you can place it into your 2nd project's source/resource directory)

-- J.

Sai Manoj Athota

unread,
Jun 25, 2016, 2:10:28 AM6/25/16
to GWT Users
Hi J,

Thanks for the quick reply. Still I am not able to build my project. Can you please have a look at my code as below,

<dependency>
<groupId>com.ex</groupId>
<artifactId>ccmscommon</artifactId>
<version>0.0.1-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.ex</groupId>
<artifactId>ccmscommon</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

Where ccmscommon is the common project.

com/ccmscommon.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module>
    <source path="ex" />
</module>

i kept ccmscommon.gwt.xml in package com.

I am inheriting the ccmscommon module in ccms.gwt.xml as below,

<inherits name="com.ccmscommon" />

If you need more information, Please let me know.

Kindly help me to resolve this. Thanks in advance.

Thanks
Sai

Sai Manoj Athota

unread,
Jun 25, 2016, 2:21:28 AM6/25/16
to GWT Users
If possible can you post an example.

Thanks
Sai

Sai Manoj Athota

unread,
Jun 29, 2016, 8:12:07 AM6/29/16
to GWT Users

Hi Team,

Can anyone help me on this.

Thanks
Sai
Reply all
Reply to author
Forward
0 new messages