0

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?

4
  • I also inherit the .gwt.xml, in the project that I am importing the library in. Commented Jul 16, 2016 at 20:05
  • Are you using this maps library? github.com/branflake2267/GWT-Maps-V3-Api? And if so, the inherits is missing for it. Commented Jul 18, 2016 at 20:36
  • Nevermind, the package path are different. Commented Jul 18, 2016 at 20:37
  • Solved it. All I needed was to include the sources in the jar and remove this: <configuration> <excludes> <exclude>**/*.java</exclude> </excludes> </configuration> from the pom.xml. Commented Jul 18, 2016 at 21:54

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.