Gradle:将 jar 依赖项包含到 Ear/libs 中

Eug*_*ghi 5 ear dependencies jar gradle

我正在使用 Gradle 创建耳朵,但我很难弄清楚如何正确地将依赖项包含在 lib 文件夹中。

我知道我可以使用

earlib project (group:name:version)
Run Code Online (Sandbox Code Playgroud)

在那里包含罐子。这些 jar 的编译依赖项也将添加到 Ear 的 lib 文件夹中。

My problem is that I also have jars that are listed in the ear's build.gradle as

deploy project (':jar-name')
Run Code Online (Sandbox Code Playgroud)

How can I add their dependencies in the lib folder?

The only way I found is to add them as earlib or as dependencies of an earlib, but this forces me to write them twice and feels harder than it should be (with Maven you just need to specify your dependencies in the subprojects and they will be added in the ear\lib directory)

EDIT

Basically what I would like to end up with, is a transitive deploy configuration.