Search code examples
javamavenjakarta-eedeploymentjar

When to put jar's into the root of the ear and when to put them into the lib folder


I have an ear where some jar's are in the root of the ear while some other jar's are inside the lib folder. That means something like the following:

myApplication.ear
  | myOtherApplication1.jar
  | lib
    | commons-lang-2.4.jar
    | myOtherApplication2.jar

This is achieved with the maven-ear-plugin.

Now I am wondering: When to put which jar where? Can't I just put everything inside the lib folder? Why would I put something in the root?


Solution

  • Standard is that ejb jars are placed in the root directory and everything else is in lib. I guess that ejb jars are not properly picked up when you put them into lib.