I'm not able to use the interfaces of an EJB-client generated by Maven.
I basically have 2 separate projects with different functions. An EAR that contains EJB's and a WAR that uses interfaces from the EJB's from the EAR package.
1.2 – EJB
WAR (with EJB-client dependency).
When I compile the WAR it comes with all the classes from the EJB module and not just the interfaces necessary for its use.
Here is pom.xml from the WAR project:
<dependency> <groupId>br.com</groupId> <artifactId>dependencia-ejb</artifactId> <version>1.0.0-SNAPSHOT</version> <type>ejb-client</type> </dependency>
For those who are facing the same problem, here is the solution:
If all your projects (both the EAR that contains the EJB's and the WAR that uses the EJB's client interfaces) are in the same workspace, you must close the EJB project before generating the WAR with the EJB-CLIENT interfaces, otherwise , the WAR project will be compiled with all the EJB classes and not just the required client interfaces.