简体   繁体   English

GWTP应用程序中生成源的Maven处理器插件顺序

[英]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.clientcom.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.

相关问题 使用maven-bundle-plugin嵌入/包含生成的源 - Embedding/Including generated sources with maven-bundle-plugin Maven 编译器插件不会将生成的类复制到测试源 - Maven compiler plugin not copying generated classes to test-sources Maven站点插件无法加载生成的源(Jaxb) - Maven-site-plugin could not load generated sources (Jaxb) jaxb2-maven-plugin将classpath添加到生成的源中 - jaxb2-maven-plugin add classpath to generated sources 是否可以在不使用插件的情况下配置 maven 来编译生成的源代码? - Is it possible to configure maven to compile generated sources wouthout the use of a plugin? maven generate-sources - 从插件中识别生成的源路径 - maven generate-sources -identify generated source paths from a plugin Java 注释处理器未在生成的源中生成文件 - Java annotation processor not generating file in generated sources 为maven-processor-plugin编写注释处理器 - Writing an annotation processor for maven-processor-plugin Maven生成的源/注释 - Maven generated-sources/annotations maven-compiler-plugin 3.6.0不会从注释编译生成的源 - maven-compiler-plugin 3.6.0 doesn't compile generated sources from annotations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM