I’ve found IntelliJ’s templating to be pretty neat - altho a bit annoyance, but it can let you create wizards and use them to generate code inside project. It’s a pretty great boost if you’ve got a framework for yourself.
I tried mustaches and annotation procesors, some custom mustache like logic, but everything feels… kinda iffy.