簡體   English   中英

GWT:導入后“沒有源代碼可用於輸入”

[英]GWT: “No source code is available for type” after import

我在導入使用org.codehaus.mojo GWT插件創建的GWT libray時遇到問題。 項目類可以很好地編譯,並且當我在同一項目中創建入口點時可以正常工作。 但是,當我將項目編譯為.jar並嘗試將其導入另一個項目時,我得到:

    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

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

這也是模塊的描述符:

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

我想念什么嗎?

創建jar時,您需要確保src包含在jar中,或者需要提供單獨的src jar並在編譯時需要src jar。

GWT同時需要類文件和源文件來編譯時間。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM