Shortest way to see Maven's supremacy in Eclipse?
-
20-04-2021 - |
Question
Suppose I have created an empty Maven project in Eclipse. What is the shortest way to observe Maven's ability of automatic jar downloading and dependency checking? For example, I need to use Swing or log4j library. How can I add them without thinking where to download?
Solution
Add a dependency, for example, Log4J 1.2.16; it will be downloaded automatically, along with its dependencies. Then check in your home directory's .m2/repository
directory.
(You'll find mvnrepository.com helpful; bookmark it!)
OTHER TIPS
Add this at the end of your pom :
<repository>
<id>jboss-nexus</id>
<url>https://repository.jboss.org/nexus/</url>
</repository>
Then go to this location and look for the artifacts you need. Once you've found them add them to your project dependencies (the site even shows the complete dependency). Run mvn install and then mvn eclipse:eclipse and voila, all done...