In java EE, which jars should I put in the library dir?

后端 未结 3 482
走了就别回头了
走了就别回头了 2021-01-04 09:28

I have a Java EE project. The project is built using maven into an .ear archive. There is a library jar containing a JPA 2 persistence unit, which is located in the library

3条回答
  •  情歌与酒
    2021-01-04 09:52

    This article has a great table explaining things:

    Table 2 A standard archive may load classes either packaged inside it or from any other archives it is dependent on.

    Module      Code Sources
    EAR 
                All JARs in the /lib directory of the EAR
                Manifest Class-Path of any JARs in 1
    EJB-JAR 
                EJB-JAR file itself
                JARs referenced by manifest Class-Path of EJB-JAR
                JARs referenced by manifest Class-Path of above JARs (in 2)
    WAR 
                WEB-INF/classes
                JARs in WEB-INF/lib
                JARs referenced by manifest Class-Path of WAR
                JARs referenced by manifest Class-Path of JARs in 2 and 3
    

提交回复
热议问题