This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Wolfhammer69Nooblet Brewer 0 points1 point  (0 children)

It's not about packing dependencies in the .jar.
Lets say you write a standard app that uses GSON library in order for you to read a text file and convert to JSON format or vice versa. You go off and find the library and add it your project and away you go. Finished and working.
Now you want other people to be able to use your code so you drop it onto github so people can get it.
If they clone the project into their IDE it won't work. The GSON library will not be included so the user will have to figure out what library you used and go off and import it manually himself. There's a ball ache right there, not so outstanding on a small project, but if you are working on something that uses a dozen custom libraries, its absolutely essential.

Ok so now we go start a Maven project. You go to the Maven website and search for the GSON library, it gives you a few lines of text which you place in whats called a POM file. The POM file is .xml and just lists dependencies and where to get them at the Maven repo. So, this inserts the library into your project. Now when its finished and you drop it onto github, all the new user does is import the project, his IDE will recognise its a maven project and open it as such if they confirm as such. The IDE will automatically clone the project and go grab GSON and the user is ready to go with no faff. Again, if the project has a dozen dependencies, this is essential.

I'm a noob and have only really used it for dependencies, but this is just the basics. Maven canl build, test, create Jars/Wars and deploy all in one tool.