什么时候把jar放到ear的根目录,什么时候放到lib文件夹

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

我有一只耳朵,其中一些罐子在耳朵的根部,而另一些罐子在 lib 文件夹中。这意味着类似于以下内容:

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

这是通过 maven-ear-plugin 实现的。

现在我在想:什么时候把哪个jar放在哪里?我不能把所有东西都放在 lib 文件夹里吗?为什么我要在根目录中放置一些东西?

如果您只需要该特定模块而不需要其他模块的任何 jar,那么您可以将这些 jar 添加到该特定应用程序 jar lib 文件夹下,否则如果您想要所有应用程序的一些 jar,则将其添加到 root ear 下

标准是ejb jar放在根目录,其他的都在lib。我猜当您将 ejb 罐子放入 lib.

时,它们没有被正确拾取