14

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?

Scott
  • 11,046
  • 10
  • 51
  • 83

2 Answers2

18

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:

enter image description here

Suraj Chandran
  • 24,433
  • 12
  • 63
  • 94
  • 1
    Thank you very much. We just finished our Java Proxy Generator for Android and this helped us not have to create some type of plugin. Glad eclipse already had the functionality – Steven Combs Oct 23 '13 at 01:55
  • Choose "Program" as external tool, and provide the path to the executable in "Location". Don't forget to change the build order, so this step is executed before the build. – Parallel Universe Dec 25 '14 at 06:25
-1

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.

bhagyas
  • 3,050
  • 1
  • 23
  • 21