如何将第三方JAR打包到EJB jar中? [英] How to package 3rd party JARs into an EJB jar?

查看:205
本文介绍了如何将第三方JAR打包到EJB jar中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧的J2EE应用程序(J2EE 1.3),它打包到EAR中,在EAR中,有WAR和EJB JAR。现在其中一个EJB JAR需要引用一些第三方库JAR,那么打包这些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?

推荐答案

它们位于根目录中的ear文件中,或者您可以创建 lib 目录来存储它们。任何需要引用它们的项目(EJB或WAR)都必须将它们包含在清单文件的
Class-Path:中。

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.

耳朵内容

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

MyEJBProj内容

 - classes
 - META-INF
    - MANIFEST.MF

MANIFEST.MF

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

这篇关于如何将第三方JAR打包到EJB jar中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆