问题
I have a project that uses jaxb for some xml processing. How can I setup a pre-build event in eclipse to execute xjc before building my project?
回答1:
Goto Project->Properties->Builders. Create your own builder and enable it. And in the configuration of the builder enable "During auto builds" etc. as shown below:

回答2:
At the moment, eclipse doesn't support this. However, you can use a build tool like Ant, Maven or Gradle for getting the same result.
There are functions in these tools which specifically allow you to execute a given task at any stage of the build.
来源:https://stackoverflow.com/questions/6415211/pre-build-events-in-eclipse