Build cache, annotation processors and configuration files

I am using an annotation processor to generate Swagger documentation.

The behaviour of this annotation processor can be tweaked from a configuration file (located under src/main/resources)

With build cache enabled, even if I change the configuration file, the compileJava task is skipped and its outputs are picked up from the build cache. This is an expected behaviour because, none of my actions are changing any java sources.

Is there an elegant way to inform gradle to not skip compileJava task whenever there are changes in the configuration files of annotation processors.