2017-08-16 104 views
1

我使用Eclipse Neon并从市场安装了GWT Eclipse插件。 我点击新建 - >新GWT web应用程序和选定的“生成一个行家项目”和“生成项目的示例代码”复选框源文件夹不属于GWT项目

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> 

+0

项目构建路径上的src/main/java? – Andrei

+0

是它在buildpath中 –

+0

你的'.gwt.rpc'文件是否包含一行,比如''? – Andrei

回答

0

转至属性 - > GWT - >常规设置 - >检查使用GWT

Figure 1

相关问题