Could I use Java 6 Annotation Processors / JSR 269 to produce code for GWT in Maven? -
since gwt works strictly on java source code, , annotation processors / jsr 269 generate java source code, there way, in maven, have javac process files, using annotation processors, , save generated java source code somewhere, such gwt can utilize itself, saving work of reproducing annotation processors implementation in gwt generator?
according this question, assuming reply still relevant, best utilize maven-processor-plugin process annotations. documentations says can specify "outputdirectory". , this question says should utilize copy-resources goal of maven-resources-plugin create source available gwt.
assuming of right, question is: how tell maven, should compile code javac, , run other (maven-processor-plugin / maven-resources-plugin) plugins before running "gwt maven plugin"? (or always, reason, happen in order anyway?)
there many ways configure maven build. here few of them:
let maven-compiler-plugin handle java compilation , annotation processing, , configure output generated sources in add-on compiling them. utilize build-helper-maven-plugin add generated sources directory project sources (or resources) later consumption gwt-maven-plugin. means build-helper-maven-plugin has run between compile , prepare-package phases.
use maven-processor-plugin run annotation processors , output generated sources, , create sure they're added project sources. disable annotation processing maven-compiler-plugin using <proc>none</proc>.
use maven-compiler-plugin twice: 1 time run annotation processors (with <proc>only</proc>), , 1 time compile files (with <proc>none</proc>). basically, first execution equivalent using maven-processor-plugin.
you shouldn't need utilize resources:copy-resources.
java maven gwt
No comments:
Post a Comment