This is true for jar dependencies. But if the war file depends on an artifact with type ejb (<type>ejb</type>), the skinnywar-option ignores this dependency and let it remain in war/lib.
And if there are two war files WAR1 and WAR2 depending on the same artifact with type ejb, the ear isn't deployable as the beans within the ejb-artifact resist in WAR1/lib _and_ WAR2/lib. The container tries to deploy beans from both loations and struggles as it cannot deploy the same bean twice. We found a workaound. We define all dependencies without the type-tag to keep the skinnywar-option working. To avoid malicious packaging inside the EAR, we define all these dependencies as jarmodules with explicit deploy path and entry in the application.xml. Such a definition looks like <jarModule> <groupId>groupid</groupId> <artifactId>artifactid</artifactId> <includeInApplicationXml>true</includeInApplicationXml> <bundleDir>/</bundleDir> </jarModule> Ugly but working. 2016-11-16 9:24 GMT+01:00 Martin Hoeller <mar...@xss.co.at>: > On 14 Nov 2016, Clemens von Musil wrote: > > > Hi again, > > > > thanks a lot for your advice, Martin. > > > > We spent a lot of time into skinny wars but stuck with ejb dependencies. > > > > The EAR contains several WAR modules and these WAR modules share several > > EJB modules. > > Unfortunately, the skinny war option seems to ignore transitive EJB > > dependencies so that we get errors with duplicate beans on startup. > > The skinnyWar-option should just remove JARs from the WAR that are also > defined in the POM of the EAR module. Nothing special about transitive > dependencies here I' guess. > > Try this again: > https://maven.apache.org/plugins/maven-ear-plugin/ > examples/skinny-wars.html > > If you list a dependency in the EAR, it should then be removed from the > WAR that is bundled with the EAR (this not the WAR installed in your > local repo!). > > If this is not the case, there is either a bug, or you are doing > something wrong. But you would need to provide more details: POMs of the > WAR and the EAR and a listing of the relevant EAR and WAR contents. > > hth, > - martin > -- Clemens von Musil - mu...@sipgate.de Telefon: +49 (0)211-63 55 56-85 Telefax: +49 (0)211-63 55 55-22 sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391 www.sipgate.de - www.sipgate.at - www.sipgate.co.uk