Generating resources after classes

I would like to use the swagger-gradle-plugin: swagger-core/ at master · swagger-api/swagger-core · GitHub

… to extract the openapi data at compile-time and then add the output file to the classpath as a generated resource.

The tricky bit is that the swagger-gradle-plugin is dependent on classes and processResources is dependent on classes, so I can’t run the swagger resolve task before processResources

If I try: tasks.processResources.dependsOn(resolve) then I get:

Circular dependency between the following tasks:
-– :processResources
-– :resolve
-– :classes (*)

Is there any way to be allowed to generate resources after the classes task has been run?