简体   繁体   English

War文件的扩展机制

[英]Extension mechanism for War file

I am looking at the extension mechanism for web application. 我正在研究Web应用程序的扩展机制。 Specific case being i want to refer jar files at certain location (outside of my war) on my system, and i don't want to duplicate them by merely copying them within my war/lib. 特定情况是我想在系统上某个位置(战争之外)引用jar文件,而我不想仅通过在war / lib中复制它们来复制它们。 To explain this further, via an installer my application will install all modules and libraries having a structure similar to say, 为了进一步说明这一点,我的应用程序将通过安装程序安装结构类似于以下内容的所有模块和库:

  • App 应用程式
    • libs
    • module1 模块1
    • module2 模块2

Now here module1 is a desktop application, containing its own set of specific jars, while common jars are used from the "libs" directory. 现在,这里的module1是一个桌面应用程序,包含其自己的一组特定jar,而从“ libs”目录使用普通jar。 Similarly module2 is a webapplication(.war) which will have specific jars bundled within the war itself however for the common jars it need to refer the "libs" folder. 类似地,module2是一个webapplication(.war),它将在战争本身中捆绑有特定的jar,但是对于常见的jar,它需要引用“ libs”文件夹。

I have been doing some reading around packing mechanisms and "Installed Packages" (ie via Extension-List) seems to be the way to achieve this. 我一直在阅读一些打包机制,“ Installed Packages”(即通过Extension-List)似乎是实现这一目标的方法。

Firstly i would like to understand if this is the only option available or are there any other ways which can help me achieve this behavior. 首先,我想了解这是否是唯一可用的选择,或者是否有任何其他方法可以帮助我实现此行为。 Secondly, for Installed Packages the referencing jars need to be present in the jre/lib/ext location only. 其次,对于已安装的软件包,引用jar必须仅存在于jre / lib / ext位置。 What this would mean is i will have to copy these common jars into the jre folder. 这意味着我将不得不将这些常见的jar复制到jre文件夹中。 I am not too keen on that option unless that the only way out. 除非那是唯一的出路,否则我不太喜欢这种选择。

Thanks, 谢谢,
Vicky 维琪

Installing stuff into the JRE directory tree is generally a bad idea. 将东西安装到JRE目录树中通常是一个坏主意。 It pollutes the JRE installation for other applications, and causes problems for the user / administrator if he/she decides to upgrade the JRE. 它会污染其他应用程序的JRE安装,如果用户/管理员决定升级JRE,则会给用户/管理员带来问题。

For the rest, it is not clear why you think you need to install things outside of the webapp (or the web container). 对于其余部分,尚不清楚为什么您认为需要在Web应用程序(或Web容器)之外安装东西。 Without this, it is hard to advise you on the best way to proceed. 没有这一点,就很难为您提供最佳的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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