gpt4 book ai didi

java - GWT、Maven 和 AspectJ : RequestFactory validation for AOPed code?

转载 作者:行者123 更新时间:2023-12-04 04:12:21 26 4
gpt4 key购买 nike

要使用 GWT 2.4.0 RequestFactory,您必须运行请求工厂验证工具。否则,它根本行不通。 [Google 说][1],只需向 pom.xml 添加 2 个插件就足够了:

  <!-- requestfactory-apt runs an annotation processor (APT) to
instrument its service interfaces so that
RequestFactoryServer can decode client requests. Normally
you would just have a dependency on requestfactory-apt
with <scope>provided</scope>, but that won't work in
eclipse due to m2e bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335036 -->
<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>${gwtVersion}</version>
</dependency>
</dependencies>
</plugin>

<!-- Google Plugin for Eclipse (GPE) won't see the source
generated above by requestfactory-apt unless it is exposed
as an additional source dir-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</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>

问题是,我有相当复杂的使用 AOP 的服务器端代码,因此当针对该代码运行验证工具时,它失败了,因为“没有方法 xxx()”、“类 xxx 没有实现接口(interface)” yyy”等

所以,我的问题是,是否可以在 pom.xml 级别解决此问题,而不是将所有 AOP 代码移至将单独编译的单独项目中?

最佳答案

通过将所有 AOP 代码移动到另一个项目来解决。

关于java - GWT、Maven 和 AspectJ : RequestFactory validation for AOPed code?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7625358/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com