java – Creating a common spring boot project with auto generated code

java – Creating a common spring boot project with auto generated code

This sounds like a good use case for creating a maven archetype if thats your build system of choice. If not, Gradle doesnt seem to have an analog of that concept.

Ive never tried to setup a template as a dependency so Im not sure how well that would work out, but what Ive done in the past is just setup a git repo that has all of the boilerplate code like youre talking about, and then cloning and adapting to the specific project. The added benefit to this is that I can update the template (like for bug fixes) independently of the projects that use it, merge in those changes, test for breaking changes, and redeploy.

You may also be interested in JHipster, which is a project generator with lots more bells and whistles (Im not associated). I havent used it that much, but the project has a huge following.

In order to complete drogniseps answer, you can find a full example of Spring boot custom maven archetype here (Which I think the best solution for your problem).

java – Creating a common spring boot project with auto generated code

Leave a Reply

Your email address will not be published. Required fields are marked *