源文件夹不属于GWT项目

时间:2017-08-16 08:11:33

标签: java eclipse maven gwt

我正在使用Eclipse Neon并从市场安装了GWT Eclipse插件。 我点击了New->新的GWT Web应用程序并选择了“生成maven项目”#39;和'生成项目示例代码'复选框

enter image description here

文件夹结构类似于

enter image description here

我正在尝试在客户端文件夹中创建一个新类。但它显示的错误如“源文件夹”不属于GWT项目。'我无法浏览到所需的文件夹。它只显示src / main / java。我是GWT的新手

我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/maven-v4_0_0.xsd">

<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.asayama.docs.gwt.angular.examples</groupId>
<artifactId>Gwt_angular_examples</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>com.asayama.docs.gwt.angular.examples.Gwt_angular_examples</name>

<properties>
    <!-- Convenience property to set the GWT version -->
    <gwtVersion>2.7.0</gwtVersion>
    <!-- Note: GWT needs at least java 1.6 -->
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencyManagement>
    <dependencies>
        <!-- ensure all GWT deps use the same version (unless overridden) -->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt</artifactId>
            <version>${gwtVersion}</version>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>${gwtVersion}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>${gwtVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>${gwtVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-codeserver</artifactId>
        <version>${gwtVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.asayama.gwt.angular</groupId>
        <artifactId>gwt-angular-ng</artifactId>
        <version>0.2.4</version>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-codeserver</artifactId>
        <version>${gwtVersion}</version>
    </dependency>
</dependencies>

  <build>
<resources>
  <resource>
    <directory>src/main/java</directory>
    <includes>
      <include>**/*</include>
    </includes>
  </resource>
</resources>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
  </plugin>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
      <execution>
        <id>copy-source</id>
        <phase>validate</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <outputDirectory>${basedir}/target/classes/com/asayama/docs/gwt/angular/site/examples/public/src/</outputDirectory>
          <resources>
            <resource>
              <directory>src</directory>
            </resource>
          </resources>
        </configuration>
      </execution>
    </executions>
  </plugin>
</plugins>

1 个答案:

答案 0 :(得分:0)

转到属性 - &gt; GWT - &gt;常规设置 - &gt;检查使用GWT

Figure 1