[英]maven processor plugin order of generated sources in a gwtp app
I'm using maven processor plugin to generate sources. 我正在使用Maven处理器插件来生成源。
<!-- Run annotation processors on src/home/java sources -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-processors</artifactId>
<version>${gwtp.version}</version>
</dependency>
</dependencies>
</plugin>
The problem is that I have generated classes that are dependent on these generated classes. 问题是我已经生成了依赖于这些生成类的类。
Eg 例如
com.project.client.application.event.DevInfoEvent.java
has a classmember of DevInfoDto com.project.shared.dto.generated.dev.DevInfoDto.java
com.project.client.application.event.DevInfoEvent.java
具有DevInfoDto的类成员com.project.shared.dto.generated.dev.DevInfoDto.java
Both files are generated, but the problem is the DevInfoEvent is generated sooner, therefore I got an error that it can't resolve the DevInfoDto 这两个文件都生成了,但是问题是DevInfoEvent生成得更快,因此出现一个错误,它无法解析DevInfoDto
When I run the generate-sources
from eclipse for the second time, it is ok, because the DevInfoDto is already generated. 当我第二次从eclipse运行
generate-sources
时,没关系,因为已经生成了DevInfoDto。 But this behavior is not good me. 但是这种行为对我不好。 (Don't want to run
compile
on the CI server twice). (不想在CI服务器上运行两次
compile
)。
Is there a way to tell maven processor plugin
some order, in which it should generate classes? 有没有一种方法可以告诉
maven processor plugin
一些顺序,在该顺序中它应该生成类?
I'd make com.project.client
and com.project.shared
two different Maven projects, declare shared
as a dependency of client
and aggregate them as <module>
s in a parent project. 我将使
com.project.client
和com.project.shared
shared
两个不同的Maven项目,将shared
声明为client
的依赖项,并将它们聚合为父项目中的<module>
。 Such, when building this parent project, Maven's reactor takes care of the proper build order. 这样,在构建此父项目时,Maven的反应堆会注意正确的构建顺序。
This also makes sense in another way: shared
functionality is probably different to client
functionality. 这在另一种意义上也很有意义:
shared
功能可能与client
功能不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.