This sounds like a dumb question but i am really confused with this. I never used maven but i know that it is used to build projects.
So, I have a question : why there is a need of building project using Maven when we can build project in Eclipse (without Maven). Just by exporting the eclipse project as JAR and include required Libraries and all.
suppose, I download any project from github. Now I can import that project in eclipse and export it as JAR and use it functionality. So why all suggest to use MAVEN to build project and generate binaries and use it.
In Normal Project, if you want to work on any third party / API applications then you have to associate those jar files and associate/configure those jar files to your project manually, whereas in Maven project provide the third party/API applications dependency in POM file and then click on Maven install then ...
To export your project, right-click it and select Export. Select Java > Runnable JAR file as the export destination and click Next. On the next page, specify the name and path of the JAR file to create and select the Launch configuration that includes the project name and the name of the test class.
Because you will soon want to build your project automatically, using automated tools and there will be no Eclipse to help you.
Possible stuff you will need soon:
Assume a simple real time scenario
Development Environment -> Production Environment (leave testing now)
In dev environment, you will have all dev friendly tools to cut short your effort in writing and spend more time in working on the logic.
Once you are done with you part, you will check it into a version control.
This should move to production now. You will check out the latest version from version control into production
Now , you cant have eclipse here too! As you are not going to develop anything. In this, case, a simple pom.xml will be used all the time and the tool called Maven
Not all the time, the developer is going to prepare the binaries. So, assume some one who is not a developer is deploying ur app. Instead of asking him to open eclipse and say export blah blah blah, You can just say, run this command/batch file. That batch file will obviously contain the maven commands (mvn compile, mvn package) etc.
Finally Eclipse is to cut short development time for developers, because, u may end up running maven again and again, due to simple typo-s which can be cut short by eclipse. In production, its one time, run a batch file. Your app is deployed
First of all, not everybody uses Eclipse (even in the same team), and different IDEs could produce slightly different artifacts (JAR files).
One advantage of Maven is that it does not only build projects:
I would recommend using Maven even for small projects :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With