简体   繁体   中英

Some necessary libraries are missing in WAR-File after export from Eclipse - why?

I took over a project of a college which contains some web services and by exporting the project as WAR-file some libraries are contained in the file (eg Axis2) and some aren't (hibernate, JDBC driver). Also a jar which is added to the class path has not been exported. All libraries are located in folders on the hard drive which means that they are not in located somewhere in the eclipse folder. If I open the WAR-file after export with WinRAR and add the libraries manually to the file the web service will work well but that is not a good solution… What could be the reason for that problem? And how can I solve it?

The jar dependencies for Eclipse to include in a war file not placed in WEB-INF/lib is not managed by the usual "project export/imports" but by a separate panel (3.6: Deployment Assembly, 3.5: Java EE Module Dependencies) in the preferences of the dynamic web project.

替代文字

Note: Since the answer was originally written, Maven has become the defacto packaging tool. Instead of relying on Eclipse features, I would strongly recommend to use Maven packaging instead. It has the additional benefit of making the project instantly usable with all modern IDE's.

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