简体   繁体   中英

How to package 3rd party JARs into an EJB jar?

I have an old J2EE application (J2EE 1.3), which packages into an EAR, and in the EAR, there are WARs and EJB JARs. Now one of the EJB JARs needs to refer to some 3rd party library JARs, so what's the best place to package those JARs and how?

They go in the ear file, at the root or you can create a lib directory to store them. Any project (EJB or WAR) that needs to reference them must include them in the Class-Path: of the manifest file.

Ear contents

  - log4j.jar
  - lib
     - commons-lang.jar
  - MyEJBProj.jar
  - MyWAR.war

MyEJBProj contents

 - classes
 - META-INF
    - MANIFEST.MF

MANIFEST.MF

    Manifest-Version: 1.0
    Class-Path: log4j.jar lib/commons-lang.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM