简体   繁体   English

有没有办法我可以使用maven基于我的构建路径中存在的jar文件自动添加依赖项?

[英]Is there a way by which i can automatically add dependencies based on the jar files present in my build path using maven?

I have a j2ee project which is having many jar files attached to it, now i want to convert it to a maven project, is it possible to get all the dependencies of the attached jar files in the pom.xml automatically without adding them one by one manually? 我有一个j2ee项目,它附加了许多jar文件,现在我想将它转换为maven项目,是否可以自动获取附加的jar文件在pom.xml中的所有依赖项,而无需添加一个手动一个?

Sorry if this is a noobish question ! 对不起,如果这是一个noobish问题!

AFAIK, you cannot. AFAIK,你做不到。

But your IDE could help you. 但是你的IDE可以帮助你。 Netbeans or Eclipse both help you to find the names of the group and the artifact for almost any library. Netbeans或Eclipse都可以帮助您查找几乎所有库的组名称和工件。

On Netbeans it is Add Dependency . 在Netbeans上,它是Add Dependency

On my opinion: yes, you can. 在我看来:是的,你可以。 Will you try such scenario: import your project into Eclipse, then convert project into Maven project throw context menu on project. 您是否会尝试这样的场景:将项目导入Eclipse,然后将项目转换为项目中的Maven项目throw上下文菜单。 It's not easy way, but this solution is worked. 这不是一件容易的事,但这个解决方案是有效的。 May be another IDE can convert more effective. 可能是另一个IDE可以转换更有效。

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

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