I have a spring boot project, in this project I have a java main class that produce an md file for documentation. Subsequently I must run a command on terminal that take this file as input and produce an html file.
I want that md and html files to be automatically generated any time that I edit java source codes.
Maven is a building/lifecycle management tool.
You need to invoke the just built application, so the answer is: you cannot (and you don't).
You have to change approach.