Ear Plugin - How to change deploy directory (ear modules)?

By default the Gradle Ear plugin copy the dependencies of the deploy configuration in the ear root. How to change this directory?

This is one attempt to move the dependencies to the lib directory. It works but the module path in the deployment descriptor file is still the root of the ear.

dependencies {
 deploy project(":product")
    filesMatching('*.jar'){file ->
<?xml version="1.0"?>

Thanks for your help very much!

remove the transitive dependencies from project(":product:) …

dependencies {
    deploy (project(":product")) { transitive = false }