[英]Deploying a war file created by maven to a glassfish server, determine the order of the classpath?
Setup 设定
I have a maven project which creates a war file, I then deploy the war file to a glassfish server (3.1). 我有一个maven项目,该项目创建一个war文件,然后将war文件部署到glassfish服务器(3.1)。
My Manifest is default one with just the basic info, but I've also tried maven-war-plugin to add classpath to the Manifest. 我的清单是默认的,只包含基本信息,但我也尝试过使用maven-war-plugin将类路径添加到清单中。 From my understanding of that plugin it should only help me determine libs outside my web-inf/lib scope.
根据我对该插件的了解,它仅应帮助我确定Web-inf / lib范围之外的库。
Problem 问题
In my war file I have two dependencies which both contain the same class but two different version of that class, so I need to specify my Glassfish Archive class loader to load them in a certain order. 在我的war文件中,我有两个依赖项,它们都包含相同的类,但是该类具有两个不同的版本,因此我需要指定我的Glassfish Archive类加载器以按特定顺序加载它们。 Now I'm completely lost as how to do this, which leads me to my questions.
现在我完全不知道该怎么做,这使我想到了问题。
Questions 问题
(I don't have privileges to comment in SO, hence the answer) The following link describes one way of managing the order of class loading.However, as others have rightly pointed out, what you are trying to achieve is not good at all. (我没有特权在SO中发表评论,因此给出了答案)以下链接描述了一种管理类加载顺序的方法。但是,正如其他人正确指出的那样,您试图实现的目标一点都不好。
https://www.java.net/node/704037 https://www.java.net/node/704037
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.