[ https://jira.codehaus.org/browse/MEAR-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=356090#comment-356090 ]
Daniel Huss commented on MEAR-166: ---------------------------------- Would love to see this fixed :-) Here is my use case: === in web module === {code:java} @Path("/hello") public class HelloResource { @Inject private HelloService helloService; ... } {code} I think this simple use case is _impossible_ to get right with <type>ejb-client</type> because the whole ejb-client mechanism is fundamentally flawed: * Depending on ejb-client artifacts will still pull all dependencies of the EJB implementation into the corresponding dependency scope. * If separating API from EJB implementation is the purpose of the ejb-client feature, the EJB artifact should depend on the API artifact and all API classes should be stripped from the EJB artifact. Since both ejb-client and ejb originate from the same POM, this is not possible (I think). ** So we end up with a <type>ejb</type> artifact plus a <type>ejb-client</type> artifact, both containing all API classes. In a JEE container such as JBoss AS 7, this will easily lead to the following situation: **# The EJB implementaiton sees API class "HelloService" loaded by class loader "A" **# The API consumer sees API class "HelloService" loaded by class loader "B" **# A.HelloService is not equal to B.HelloService **# CDI fails because of unsatisfied dependencies In my opinion <type>ejb-client</type> should never be used as a maven dependency for those reasons. If I could, I'd simply avoid using the maven-ejb-plugin by creating two plain <packaging>jar</packaging> projects. However, this is not an option because the ear plugin requires <type>ejb</type> for <ejbModule>s (and I do like the ear plugin :-) ) > 'skinnyWar' doesn't work well with dependencies of type 'ejb' > ------------------------------------------------------------- > > Key: MEAR-166 > URL: https://jira.codehaus.org/browse/MEAR-166 > Project: Maven Ear Plugin > Issue Type: New Feature > Affects Versions: 2.8, 2.9 > Environment: many different environments I've verified this on > Reporter: Michal Michalski > Priority: Minor > Fix For: more-investigation > > > It seems that 'skinnyWar' works OK with dependencies of type 'jar', but it > does left 'ejb' dependencies in WEB-INF/lib. Finally, these dependencies > exist both in EAR's lib dir and WEB-INF/lib within WAR, when using classic > trick with both 'war'-type and 'pom'-type dependency to WAR, so all WAR's > dependencies should go to EAR's lib. -- This message was sent by Atlassian JIRA (v6.1.6#6162)