0

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?

Sorry if this is a noobish question !

Sujal Mandal
  • 975
  • 1
  • 14
  • 29
  • 3
    Even if there's an automated solution, I'd recommend doing this manually. Take this opportunity to audit your dependencies, and make sure your POM only declares the components you depend upon directly (and not their transitive dependencies). You'll end up with a shorter list that will more accurately model your project's dependencies. – dnault Feb 23 '15 at 05:56
  • 1
    By the way, it's worth evaluating Gradle as an alternative to Maven. (I'm not affiliated with Gradle -- just a happy user.) – dnault Feb 23 '15 at 05:59
  • @dnault while your first comment makes a lot of sense indeed, your second is an opinion-based (crappy) suggestion – guido Feb 23 '15 at 06:02
  • You may find your answer here, http://stackoverflow.com/questions/2037188/how-to-configure-eclipse-build-path-to-use-maven-dependencies – Sandeep Patange Feb 23 '15 at 06:49

2 Answers2

0

AFAIK, you cannot.

But your IDE could help you. Netbeans or Eclipse both help you to find the names of the group and the artifact for almost any library.

On Netbeans it is Add Dependency.

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
0

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. It's not easy way, but this solution is worked. May be another IDE can convert more effective.