I’m trying to use the ear plugin with war. This is the instruction.
// The following dependencies will be the ear modules and
// will be placed in the ear root
// The following dependencies will become ear libs and will
// be placed in a dir configured via the libDirName property
// earlib group: 'log4j', name: 'log4j'
But instead, I have to use this from the threads in the forum.
Could you please provide a reproducible example project or point me to the bug report?
I’m trying to create an ear using with ear plugin. The ear project has a dependency on a war project, among other dependencies.
Here’s a simplified version of the ear project’s build.gradle.
apply plugin: 'ear'
The mywar project uses the war plugin and seems to work fine, creating a war archive.
However, when I try to assemble the ear, Gradle creates a jar archive of the war project and includes the jar as an ejb dependency! Even the appl…
Here’s the discussion for the bug. There’s a workaround.
And here’s the bug reporting 5 years ago. And it’s never fixed.
Thank you for the pointer Seto! This is unfortunately not easy to fix. It will require usage-aware dependency resolution, so we can tell apart the case “I want to compile against this project” from “I want to package this project for deployment”.
I’ve corrected the user guide to use the workaround discussed in the bug report.
Where did you update the user guide? I found it’s not fixed yet. Or does it apply to the next version user guide?
The updated user guide will be part of the Gradle 3.1 release.
Hi. I found the example in 3.1 doc is still “deploy project(’:war’)”. Or do I miss something?
Thanks for the heads-up! I had missed that second sample project and only changed the first one.
Fixed for 3.2.