2016-07-16 13 views
0

Ich habe ein Problem beim Importieren einer GWT-Bibliothek, die ich mit dem org.codehaus.mojo GWT-Plugin erstellt habe. Die Projektklassen werden ordnungsgemäß kompiliert und funktionieren einwandfrei, wenn ich einen Einstiegspunkt innerhalb desselben Projekts erstelle. Allerdings, wenn ich das Projekt als .jar kompilieren, und versuchen Sie es in ein anderes Projekt zu importieren, erhalte ich:GWT: "Kein Quellcode ist für den Typ verfügbar" nach dem Import

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 

hier ist ein Extrakt aus der 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> 

Hier auch das Modul der Deskriptor:

<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> 

Fehle ich etwas?

+0

Ich erben auch die .gwt.xml, in dem Projekt, das ich die Bibliothek importieren. –

+0

Verwenden Sie diese Kartenbibliothek? https://github.com/branflake2267/GWT-Maps-V3-Api? Und wenn das so ist, fehlen die Erben dafür. – Branflake2267

+0

Vergesst, der Paketpfad ist unterschiedlich. – Branflake2267

Antwort

1

Wenn Sie Ihr jar erstellen, müssen Sie entweder sicherstellen, dass der src im jar enthalten ist oder Sie ein separates src-jar bereitstellen und das src-jar zur Kompilierzeit benötigen.

GWT benötigt sowohl die Klassen- als auch die Quelldatei für Kompilierzeitabhängigkeiten.