zakaria amine
zakaria amine

Reputation: 3682

GWT: "No source code is available for type" after import

I am having an issue importing a GWT libray that I have created using org.codehaus.mojo GWT plugin. The project classes compile fine, and work fine when I create an entry point within the same project. However, when I compile the project as a .jar, and try to import it into another project, I get:

    Tracing compile failure path for type 'com.test.client.test'
[INFO]          [ERROR] Errors in 'file:/C:/Users/zakaria/Desktop/myWork/GWidgets/workspace/testing/src/main/java/com/test/client/test.java'
[INFO]             [ERROR] Line 23: No source code is available for type com.gwidgets.leaflet.options.MapOptions; did you forget to inherit a required module?
[INFO]             [ERROR] Line 23: No source code is available for type com.gwidgets.leaflet.options.ZoomPanOptions; did you forget to inherit a required module?
[INFO]             [ERROR] Line 23: No source code is available for type com.gwidgets.leaflet.L; did you forget to inherit a required module?
[INFO]       [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

here is an extract of the pom.xml:

  <build>
    <!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode -->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

    <plugins>

      <!-- Mojo's Maven Plugin for GWT -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.8.0-beta1</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test</goal>
              <goal>generateAsync</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <runTarget>GwtyLeaflet.html</runTarget>
          <modules>
            <module>com.gwidgets.GwtyLeaflet</module>
          </modules>
          <jsInteropMode>JS_RC</jsInteropMode>
        </configuration>
      </plugin>
    </plugins>
  </build>

Here is also the module the descriptor:

 <module rename-to='GwtyLeaflet'>
   <inherits name='com.google.gwt.user.User' />
  <inherits name="com.google.gwt.core.Core"/>
   <inherits name='com.gwidgets.api.GwtyLeaflet' />

  <source path='leaflet'/>

</module>

Am I missing something?

Upvotes: 0

Views: 2103

Answers (1)

JDL
JDL

Reputation: 1507

When creating your jar, you either need to make sure the src is included in the jar or that you provide a separate src jar and require the src jar at compile time.

GWT requires both the class and source files for compile time dependencies.

Upvotes: 2

Related Questions