I am facing another problem in my little test-webapp.
I have an EJB module (created via maven-pom) that basically wraps the data-access, so all it does is some DAOs implemented as Stateless-SessionBeans. My domain-model (simple POJOs with JPA2 annotations) is located in another, simple java, project that will be packaged as jar-file.
When I create the enterprise-archive, maven only puts the webapp and the ejb-module into the application.xml and even when I change this manually the ejb-module cannot find the classes from the domain-module at deployment time.
I read something about that an ejb has to have all its dependent jars within its own archive but I cant believe that since this domain-module is used by other projects as well.
How would I package this (or set it up in maven) so my ejb can load classes from an external jar?
thanks
If I remember well, simply generate a manifest with a Class-Path entry in your EJB-JAR:
And add your external jars to the EAR. To do so, declare them as
jarModulein the Maven EAR plugin configuration. See modules configuration.