0

I've been coding Java in Eclipse for awhile without needing to specify dependencies. Now that I learned how Maven does it, I'm wondering: how did Eclipse build projects on its own? How did Eclipse figure out which versions of imports, and which dependencies of dependencies, are needed to make everything work?

Finally, what are the advantages and disadvantages of building a project in Eclipse by starting with New->Other->Maven Project instead of New->Java Project?

user1956609
  • 2,132
  • 5
  • 27
  • 43

2 Answers2

1

To the first question: Eclipse doesn't add any dependency in a standard Java project. You have to manually add to the Build Path all needed JARs, otherwise you'll have compilation errors.

To the second question: if you create a standard Java project Maven is not used, even if you create a pom.xml file in the root of the project. You can always convert a standard Java project in a Maven project (see Convert Existing Eclipse Project to Maven Project).

Community
  • 1
  • 1
0

Your dependencies has always to be in the classpath When you start a project with Maven, Eclipse will automatically add the Maven repository to the classpath.

When you start a Java project you have to link your library manually in Eclipse and the version of the library is the one you've downloaded.

You can see the difference in your project's Properties > Java Build Path > Libraries

RPresle
  • 2,436
  • 3
  • 24
  • 28