2015-11-04 30 views
0

有沒有人在GWTP Boilerplate Generation的Eclipse Annotation Processing指示下成功?我遵循Eclipse Annotation Processing的指示,但無法導入GWTP註釋包。GWTP Boilerplate Generation - Eclipse Annotation Processing

我很感謝任何有關Eclipse Annotation Processing或提及的Maven Configuration setup的任何見解。

這些是GWTP Boilerplate Generation方向(頁面底部):

Eclipse的註解處理

在Eclipse中,只要你保存你的工作文件上的註解處理器踢並逐步更改 只更改所需的文件。另一種方法是使用Eclipse生命週期映射。如果使用生命週期 映射,則不必設置註釋處理器。瞭解更多關於 的Maven配置如何設置註釋處理而不用觸摸eclipse屬性。

要啓用GWTP註釋處理在eclipse:

  • 打開您的項目
  • 勾選標註處理網頁上的所有箱子屬性。 選中「註釋處理」頁面上的所有框。
  • 將GWTP jar添加到工廠路徑。 將GWTP jar添加到工廠路徑。

回答

0

Maven中你可以試試這個:

1)進口gwtp處理器

<dependency> 
<groupId>com.gwtplatform</groupId> 
<artifactId>gwtp-processors</artifactId> 
<version>${gwtplatform.version}</version> 
</dependency> 

2)使用下一個插件

<!-- Run annotation processors on src/home/java sources --> 
    <plugin> 
       <groupId>org.bsc.maven</groupId> 
       <artifactId>maven-processor-plugin</artifactId> 
       <version>2.0.5</version> 
       <executions> 
        <execution> 
         <id>process</id> 
         <goals> 
          <goal>process</goal> 
         </goals> 
         <phase>generate-sources</phase> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>com.google.web.bindery</groupId> 
         <artifactId>requestfactory-apt</artifactId> 
         <version>${gwt.version}</version> 
        </dependency> 
       </dependencies> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>build-helper-maven-plugin</artifactId> 
       <version>1.9</version> 
       <executions> 
        <execution> 
         <id>add-source</id> 
         <phase>generate-sources</phase> 
         <goals> 
          <goal>add-source</goal> 
         </goals> 
         <configuration> 
          <sources> 
           <source>${project.build.directory}/generated-sources/apt</source> 
          </sources> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin>