Maven-procesor-plugin można zrobić ...
https://code.google.com/p/maven-annotation-plugin/
Przykład z dokumentacją:
<build> <plugins>
<!-- Run annotation processors on src/main/java sources -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<!-- Disable annotation processors during normal compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
</plugins> </build>
W tej odpowiedzi jest dużo dobrych rzeczy. Ale jedno nie jest prawdą: możesz to zrobić w jednym przejściu maven. Oto przykład, który obejmuje także procesor adnotacji używający JCodeModel: https://github.com/jjYBdx4IL/example-maven-project-setups/tree/master/compile-time-annotation-processing – user1050755
@ user1050755 Dzięki za wspaniałą propozycję . Jedno pytanie: dlaczego użyłeś tego JCodeModel, a nie oficjalnego? https://github.com/javaee/jaxb-codemodel –
ponieważ jcodemodel naprawia błędy. – user1050755