简体   繁体   English

Eclipse动态Web应用程序将jar文件放在WEB-INF / lib和Java Build Path中

[英]Eclipse Dynamic Web Application putting jar files in WEB-INF/lib and Java Build Path

I have a very "basic" question regarding Java web application development (servlet). 关于Java Web应用程序开发(servlet),我有一个非常“基本”的问题。 What is the difference between putting a jar file in WEB-INF/lib and putting it in Java Build Path/Library/External Jar? 将jar文件放入WEB-INF / lib和将其放入Java Build Path / Library / External Jar之间有什么区别?

Java Build Path/Library/External Jar is only managed by eclipse so if you build war and if your builder (or if you build externally) doesn't copy over these jars to WEB-INF/lib then you would loose them at runtime Java Build Path/Library/External Jar仅由eclipse管理,因此,如果您进行战争构建,并且如果您的构建器(或外部构建)没有将这些jar复制到WEB-INF/lib那么您将在运行时将其释放

also when you share that code with other developers, or if you use other IDE it will not help 同样,当您与其他开发人员共享该代码时,或者如果您使用其他IDE也无济于事

better to use some standard and mature dependency manager / build tool like maven than copying over library to WEB-INF/lib manually 与手动将库复制到WEB-INF/lib相比,使用一些标准且成熟的依赖管理器/构建工具(如maven)更好

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

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