Using classes instead of jar for compilation: how to perform processResources?

Hi, I have multi-project build with following structure:

  • server (java app)
    • common (java library)
    • ui (java library)

I have a task in ui project which produces resources (hooked to processResources). This custom task runs fine if I execute :ui:classes.

However, if I perform :server:classes to build the project before running, I’ve noticed that :ui:processResources is not executed. It looks like this is by design:

A feature of the java-library plugin is that projects which consume the library only require the classes folder for compilation, instead of the full JAR. This enables lighter inter-project dependencies as resources processing (processResources task) and archive construction (jar task) are no longer executed when only Java code compilation is performed during development.
The usage or not of the classes output instead of the JAR is a consumer decision. For example, Groovy consumers will request classes and processed resources as these may be needed for executing AST transformation as part of the compilation process.

My :server project requires both classes and resources to run. Is there a way to disable this behaviour or at least mitigate it?


My current workaround: replaced java-library with java in :ui and :common.