How to run Java codegen as part of Maven compilation

The docs state that I must add this Maven dependency for Java codegen. But how do I get Java codegen to run (daml codegen java) and update the generated Java code every time I rebuild my project or do a mvn compile?

Note that that requirement is not to run the codegen, but rather to be able to compile the output of the codegen. If you want to run this automatically, you would have to make a Maven plugin that runs the codegen itself and make your compile phase depend on that.

1 Like