简体   繁体   English

从Eclipse将Web项目导出为War文件时,无法导出非jar文件

[英]Unable to export non-jar files when web project is exported as a war file from Eclipse

I have developed a dynamic web application in Eclipse. 我在Eclipse中开发了一个动态Web应用程序。 I am using Tomcat as a server. 我正在使用Tomcat作为服务器。 In my lib folder I have placed one non-jar files( addressing.mar ). 在我的lib文件夹中,我放置了一个非jar文件( addressing.mar )。 This file is necessary other wise I get an error in my application. 否则,此文件是必需的,否则我的应用程序中会出现错误。

Now I export my project as war file and then deploy the project on Tomcat server. 现在,我将项目导出为war文件,然后在Tomcat服务器上部署该项目。 When I run the project I get an exception because addressing.mar cannot be found in the lib folder of the project. 运行项目时,出现异常,因为在项目的lib文件夹中找不到addressing.mar I don't know why addressing.mar isn't exported. 我不知道为什么address.mar没有导出。 If I manually place file in it, it is working, but I need a better solution. 如果我手动将文件放入其中,则它可以工作,但是我需要一个更好的解决方案。

Right click the project, open properties. 右键单击项目,打开属性。 Under the Deployment Assembly page, you can configure what resources to include during export and their path in the WAR file. 在“部署程序集”页面下,您可以配置导出期间要包括的资源及其在WAR文件中的路径。 Just include your jar there and it will show up next time you export. 只需将您的罐子放在那里,它将在您下次导出时显示。

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

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