Cannot achieve incremental deployment (Hot Swapping) in Gradle 9.2.1 Multi-Module Project (Eclipse WTP)

Greetings,

I have a multi-module project (Gradle 9.2.1, Java 21, Tomcat 11, Jakarta EE) that has lost its developer inner loop efficiency due to a Deployment Assembly configuration failure.

Goal: When a source file changes in a sub-project (e.g., :agp-core), the change must be instantly deployed to the running Tomcat server via Eclipse WTP’s exploded deployment.

Problem: We cannot find the correct syntax to instruct the eclipse-wtp plugin to create a dynamic project output link in the Deployment Assembly. The resulting build forces us to run a gradle build with a static JAR copy, requiring a full server restart for every code change.

We have a web project (:agp-web) and five Java sub-projects (e.g., :agp-core).

Desired Deployment Assembly Result:

  • Source: /agp-core (Project) Deploy Path to :agp-web’s WEB-INF/lib (This links the compiled classes)

Syntaxes Attempted to be used in the ‘eclipse { wtp { component { … } } }’ block (All Failed with either Could not find method… or Cannot cast LinkedHashMap… etc…):

  1. Modern Preferred: projectDependency project(‘:agp-core’)

  2. Basic Linking: dependsOn project(‘:agp-core’)

  3. Manual Resource Addition: resources.add(new WbResource(…))

  4. Low-Level Map Coercion: resources << [sourcePath: …, deployPath: ‘WEB-INF/lib’]

  5. File Deploy path: file deployPath: ‘WEB-INF/lib’, source: project(‘:agp-core’).configurations.runtimeClasspath

  6. Tried fileSet too: fileSet(project(‘:agp-core’).configurations.runtimeClasspath) { deployPath = ‘WEB-INF/lib’ }

  7. Using a File Block:

            file {
                deployPath = 'WEB-INF/lib'
                source = project(':agp-core').configurations.runtimeClasspath.files
            }
    

Question: Given that every standard and non-standard API I’ve tried for WTP project linking is failing to compile on Gradle 9.2.1, what is the current, guaranteed, and stable syntax to configure a dynamic project link within the ‘eclipse { wtp { component { … } } }’ block? Is there an alternative that I may have missed?

Any insight into a potential API change, bug, or environment-specific trick would be greatly appreciated. Thank you!