[英]How can i add the jars in my lib folder as individual dependencies using maven
I have a legacy Java Webapp (Struts2), where all my dependencies are present in WebContent/WEB-INF/lib folder. 我有一个遗留的Java Webapp(Struts2),我的所有依赖项都位于WebContent / WEB-INF / lib文件夹中。 I have tried to convert the entire project to Maven using Eclipse>Configure>Convert-to-Maven-Projet and new pom file was generated successfully. 我尝试使用Eclipse> Configure> Convert-to-Maven-Projet将整个项目转换为Maven,并成功生成了新的pom文件。
How can i add the jars in my lib folder as individual dependencies in my pom.xml
and manage them using pom.xml
. 如何在我的lib文件夹中将jars添加为pom.xml
各个依赖项,并使用pom.xml
对其进行管理。 I don't want to point to the lib folder during maven package and include the jars in my final war file, instead i would like to get rid of the all the jars in lib folder and manage them using pom.xml
, just like any other Maven Project. 我不想在maven打包期间指向lib文件夹并将jar保存在我的最终war文件中,而是想摆脱lib文件夹中的所有jar并使用pom.xml
对其进行管理,就像任何其他方式一样其他Maven项目。
What is the best way to achieve this ? 实现此目标的最佳方法是什么? Is there any automated process or do i need to manually add dependencies in pom.xml
? 是否有任何自动化过程,或者我需要在pom.xml
手动添加依赖项? (FYI - all my jars are standard Java dependencies like Struts,Log4j,Apache Commons etc., so i can get them from Maven central repo). (仅供参考-我所有的jar都是标准Java依赖项,例如Struts,Log4j,Apache Commons等,因此我可以从Maven中央存储库中获取它们)。
There isn't an automatted process to do that task for you, because jars can be included in different dependencies. 没有自动执行的过程可以为您完成此任务,因为jar可以包含在不同的依赖项中。 You have to add them manually to your pom file. 您必须将它们手动添加到pom文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.