【问题标题】:GWTP Boilerplate Generation - Eclipse Annotation ProcessingGWTP 样板生成 - Eclipse 注释处理
【发布时间】:2015-11-04 19:17:00
【问题描述】:
有没有人按照 GWTP Boilerplate Generation 的 Eclipse 注释处理指示成功?我按照 Eclipse Annotation Processing 的说明进行操作,但无法导入 GWTP 注释包。
如果您对 Eclipse 注释处理或其他提到的 Maven 配置设置有任何见解,我将不胜感激。
这些是来自 GWTP Boilerplate Generation(页面底部)的路线:
Eclipse 注释处理
在 Eclipse 中,注释处理器会在您保存正在处理的文件后立即启动,并以增量方式进行
仅更改所需的文件。另一种方法是使用 Eclipse 生命周期映射。如果生命周期
使用映射,注释处理器不必设置。在 Maven 配置中了解更多信息
如何在不触及 eclipse 属性的情况下设置注释处理。
在eclipse中启用GWTP注解处理:
- 打开项目的属性
- 勾选注释处理页面上的所有框。
勾选注释处理页面上的所有框。
- 将 GWTP jar 添加到工厂路径。
将 GWTP jar 添加到工厂路径。
【问题讨论】:
标签:
eclipse
maven
annotations
boilerplate
gwtp
【解决方案1】:
在 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>