java - GWT 模块 ... 在项目源或资源中找不到

标签 java gwt

我是 GWT 的新手。我尝试制作一个 Web 应用程序并使用以下 Maven 配置来配置 gwt。我将它放在配置文件中,因此只有在调用配置文件时才会编译 gwt。

简介是这样的:

<profiles>
        <profile>
            <id>gwtCompile</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <version>2.5.0</version>
                        <configuration>
                            <extraJvmArgs>-Xmx512M -Xss1024k </extraJvmArgs>
                            <module>com.mycompany.MyMainModule</module>
                            <inplace>true</inplace>
                            <force>true</force>
                            <disableCastChecking>true</disableCastChecking>
                            <style>PRETTY</style>
                            <warSourceDirectory>${basedir}/war</warSourceDirectory>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>com.google.gwt</groupId>
                                <artifactId>gwt-user</artifactId>
                                <version>${gwt.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>com.google.gwt</groupId>
                                <artifactId>gwt-dev</artifactId>
                                <version>${gwt.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>compileJS</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

当我运行命令时:

   mvn clean install -Dmaven.test.skip=true -PgwtCompile

它给了我错误信息:

GWT Module com.mycompany.MyMainModule not found in project sources or resources.

我的 MyMainModule.gwt.xml 是这样的:

<?xml version="1.0" encoding="UTF-8"?>
<module>
    <inherits name='com.google.gwt.user.User' />

    <entry-point class='com.mycompany.MyMainModule' />

    <source path='client' />
    <source path='shared' />
</module>

我可以看到一些在线文档说多模块项目应该有这个错误。但是 mime 不是一个多模块项目。

谁能告诉我这可能出了什么问题?

非常感谢。

编辑:

我已经准备好了:

<resources>
    <resource>
        <directory>${basedir}/src/main/java</directory>
        <includes>
            <include>**/client/**</include>
            <include>**/*.gwt.xml</include>
        </includes>
    </resource>
    <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
            <include>**/*</include>
        </includes>
    </resource>
</resources>

最佳答案

尝试在构建标签中添加资源标签。

<build>
    <resources>
        <resource>
            <directory>${basedir}/src/main/java</directory>
        </resource>
        <resource>
            <directory>${basedir}/src/main/resources</directory>
        </resource>
    </resources>
    <!-- **Other build tags** -->
</build>

关于java - GWT 模块 ... 在项目源或资源中找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15322675/

相关文章:

java - 除非有新日志,否则 TimeBasedRollingPolicy 不会滚动

java - Hibernate 使 Weld 不在 Java SE 中初始化

java - 如何将 Java 中的 150 位整数(或 30 个 5 位整数)转换为 mysql 中的高效存储格式?

java - GWT RPC Cookie 身份验证

gwt - 使用非默认源目录在 GWT 中定义模块

GWT-复选框 : rounded edges

基本计时器上的 Java IllegalThreadStateException

java - 如何通过 Servlet 在我的项目文件夹中创建一个文件?

java - 用于 GWT 的静态 Google 地球 map

java - GWT 作为非 Web 应用程序的一部分