In Apache Camel, we do use javadoc during the build as we have a few things that are generated from the javadoc. However, javadoc can take quite some time to build, so I came up with a stale file/config detection mechanism in order to avoid recomputing the javadoc if there is no change.
The idea is to compute an input state consisting of all the command line options (flattening the @xxx options) and the list of all input files along with their last modification date. Before actually executing the command line, we compare the current state with the last saved state and skip the execution if there is no change.
The code is visible in this commit mainly: https://github.com/apache/camel/pull/3233/commits/57903a94f82413022afc594e374fb3dff4f7578a and if there is an agreement, I can create a correct PR to incorporate the change.