Reputation: 423
I have a Maven project in Eclipse that's running some commands to generate a couple files (these files are placed on the Classpath of another Java project). When the "Build Automatically" option is checked, instead of running the typical builders, I would like it to run "mvn generate-sources", add that folder to the project Classpath, and refresh the directory so the new generated files are available to the other project.
I tried adding a custom builder that runs a dummy program and refreshes the directory containing the generated files, but when Eclipse detects that those generated files have been changed, it triggers another rebuild, which causes Eclipse to go into this infinite loop of rebuilding this project. How can this project be set up to automatically regenerate these files without sending Eclipse into this infinite loop? Does a custom plugin need to be created?
Upvotes: 2
Views: 1236
Reputation: 423
The other Builders in the project were causing the infinite loop. Right clicking the project -> Properties -> Builders -> Deselect all the other builders in the project except the custom one.
After doing this, the project properly rebuilds itself automatically without going into an infinite loop, and the other projects pick up the changes automatically.
Upvotes: 1