"No source code is available for type... did you forget to inherit",相同的模块,只是兄弟源目录(迁移 gwt-maven-plugin)
"No source code is available for type... did you forget to inherit", same module, just sibling source-directory (migrating the gwt-maven-plugin)
我收到“net.jzaruba.theapp.data.ColorFormResource 类型没有可用的源代码;您是否忘记继承所需的模块?”位于同一个 Maven 模块中的 class (net.jzaruba.theapp.client.TheEntryPoint) 中的错误,就在所谓缺失类型旁边的同级 directory/package 中。
TheApp/Web/src/main/module.gwt.xml:
<module>
<inherits name='com.google.gwt.user.User' />
<inherits name='net.sf.gilead.Adapter4Gwt15'/>
<inherits name="com.smartgwt.SmartGwt"/>
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
<inherits name="com.googlecode.gwt.math.Math"/>
<!-- MY OTHER MODULES -->
<inherits name="net.jzaruba.theapp.Core" />
<inherits name="net.jzaruba.theapp.Domain" />
<source path='net/jzaruba/theapp/client'/> <!-- HERE LIVES THE OFFENDING CLASS -->
<source path='net/jzaruba/theapp/data'/> <!-- THE SUPPOSEDLY UNREACHABLE TYPES -->
<entry-point class='net.jzaruba.theapp.client.TheEntryPoint' />
</module>
TheApp/Web/pom.xml:
<project>
...
<packaging>gwt-app</packaging>
...
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>net.jzaruba.theapp.TheApp</moduleName>
<jvmArgs>-javaagent:${org.projectlombok:lombok:jar}=ECJ</jvmArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
源路径应该相对于 GWT 模块的根目录,在您的例子中是 net/jzaruba/theapp
。所以你应该有这个:
<source path='client'/>
<source path='data'/>
我认为它是在 client
中找到 class,因为如果不存在其他路径,那是 GWT 默认值。
我收到“net.jzaruba.theapp.data.ColorFormResource 类型没有可用的源代码;您是否忘记继承所需的模块?”位于同一个 Maven 模块中的 class (net.jzaruba.theapp.client.TheEntryPoint) 中的错误,就在所谓缺失类型旁边的同级 directory/package 中。
TheApp/Web/src/main/module.gwt.xml:
<module>
<inherits name='com.google.gwt.user.User' />
<inherits name='net.sf.gilead.Adapter4Gwt15'/>
<inherits name="com.smartgwt.SmartGwt"/>
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
<inherits name="com.googlecode.gwt.math.Math"/>
<!-- MY OTHER MODULES -->
<inherits name="net.jzaruba.theapp.Core" />
<inherits name="net.jzaruba.theapp.Domain" />
<source path='net/jzaruba/theapp/client'/> <!-- HERE LIVES THE OFFENDING CLASS -->
<source path='net/jzaruba/theapp/data'/> <!-- THE SUPPOSEDLY UNREACHABLE TYPES -->
<entry-point class='net.jzaruba.theapp.client.TheEntryPoint' />
</module>
TheApp/Web/pom.xml:
<project>
...
<packaging>gwt-app</packaging>
...
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>net.jzaruba.theapp.TheApp</moduleName>
<jvmArgs>-javaagent:${org.projectlombok:lombok:jar}=ECJ</jvmArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
源路径应该相对于 GWT 模块的根目录,在您的例子中是 net/jzaruba/theapp
。所以你应该有这个:
<source path='client'/>
<source path='data'/>
我认为它是在 client
中找到 class,因为如果不存在其他路径,那是 GWT 默认值。