GWT。 Maven的。 GWT模块< module_name>没有在项目来源或资源中找到 [英] GWT. Maven. GWT Module <module_name> not found in project sources or resources

查看:221
本文介绍了GWT。 Maven的。 GWT模块< module_name>没有在项目来源或资源中找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个maven多模块项目。其中一个模块(编译为 .jar )仅包含域对象,将在客户端和服务器端使用(我将 .jar 作为对其他模块的依赖)。

我知道GWT模块将使用来自共享 .jar 的对象,其中还必须有源文件编译成功。所以我试图添加到我的 pom.xml 两者中:

 < ;资源> 
< resource>
<目录> src / main / java /<路径>< / directory>
<包括>
< include> ** / *。java< / include>
< include> ** / *。gwt.xml< / include>
< / includes>
< / resource>
< /资源>

 < plugin> 
< groupId> org.codehaus.mojo< / groupId>
< artifactId> gwt-maven-plugin< / artifactId>
< versionRange> [$ {gwt.version}]< / versionRange>
<目标>
<目标>资源< /目标>
< /目标>
< plugin>

结果 .jar 不包含GWT模块源代码(即 gwt.xml )。所有的域类源也被添加(在 .jar 的根目录下),但是 ModuleName.gwt.xml 不。

问题在哪里?如果你的 .gwt.xml 文件在中,那么你可以使用

解决方案 code> src / main / resources / 如果您指定 src / main / java / 作为资源,它将不会被复制路径...



您应该省略< resource> 部分,让GWT插件包含源代码在jar或至少有两个部分,一个用于 .gwt.xml 文件( src / main / resources 或者你把它放在哪里),一个用于源代码(就像你现在这样做)。



干杯,


I have a maven multi-module project. One of this modules (compiled as .jar) contains only domain objects, which will be used at client and server sides (I add this .jar as dependency to other my modules).

I know that GWT module, where will be used objects from shared .jar, must also have source files for successful compilation. So I tried to add to my pom.xml both:

        <resources> 
            <resource>
              <directory>src/main/java/<path></directory> 
              <includes> 
                <include>**/*.java</include> 
                <include>**/*.gwt.xml</include> 
              </includes> 
            </resource> 
        </resources>  

and

 <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <versionRange>[${gwt.version}]</versionRange>
    <goals>
        <goal>resources</goal>
    </goals>
 <plugin>

But resulting .jar don't contain GWT module source (i.e gwt.xml). All sources of domain classes are added as well (at root directory of .jar), but ModuleName.gwt.xml not.

Where is problem? Thanks.

解决方案

If your .gwt.xml file is in src/main/resources/ then it won't get copied if you specify src/main/java/ as the resource path...

You should probably omit the <resource> section and let the GWT plugin include the source in the jar or at least have two sections, one for the .gwt.xml file (src/main/resources or where you put it) and one for the source code (as you have it now).

Cheers,

这篇关于GWT。 Maven的。 GWT模块&lt; module_name&gt;没有在项目来源或资源中找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆