问题
points out the -gen argument to compiler
As pointed out in the above post I added the gen flag by modifying my gwt maven plugin configuration like this
<gen>genSource</gen>
Funny thing it does write the generated classes but only the gwt core generator classes. none of my own custom generator classes output is written into it.
Any clues as to what could be wrong ?
回答1:
To do this, I am assuming you are using Eclipse with GWT plugin. right click on Gwt project Run As->Run Configuration,
- Select the "Java Application" on the left side. Right click on it,
and select "New". This will create a new run configuration named "New Configuration" In the "New Configuration" ,you should be in the "Main" tab. Make sure that in the "Project" text box correct GWT project is selected. If not, you can select the right GWT project by clicking the "Browse" button next to it.
Also in the main tab, click on the "Search" button next to "Main Class" text box. Write "Compiler" in the popup window and select "com.google.gwt.dev.Compiler".
- Go to the "Arguments" tab. Again you have two text boxes, program arguments (which are the GWT compiler arguments) and VM arguments. Put your GWT module name(eg.com.xyz.ModuleName) in the first line of your program argument box and in second line put -gen destinationPath(destinationPath is where you want to generate classes).
- finally click on apply button and run the configuration.after finishing compilation refresh the project and check destination folder path you will get generated classes.
回答2:
I found a solution -
the generated files incase of a maven based project are created in a hidden folder in target named .generated and contains all generated files. It was that simple. This solves the entire problem and now we are able to study and fix generator problems.
the gen tag in compiler configuration still doesn't work for my own custom generators and I haven't figured why.
来源:https://stackoverflow.com/questions/33892627/gwt-compiler-option-to-see-generated-files-from-custom-generator-with-gwt-maven