Maven Tutorial Practical

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so welcome back guys in this video we'll talk about the practical implementation of mavin so in the last video we have talked about the theory of mavin so just to give a quick recap what is mavin so mavin is a build tool so let's say you want to create a new project in which you want a project structure you want something that will compile your files you want something which will test your application and you want something which will give you all the required libraries so the main problem arise when you have you when you want to create an application using spring so let's say you want to build an application in which you have to use spring maybe you have to use hibernate for those spring and hibernate we have we require some dependencies which is libraries so I'm going to work with hibernate you require lab is to work with spring or starts you require lab use now to to get all the saplings you have to go to a website which is like say spring dot IO and you can download your libraries here that's very easy right but the problem is so when you go to go to this spring so where you will get all the Java files required so if you click on this project you can see spring provides lots of frameworks so we'll select spring framework here and if I go to spring framework I have option of download T jar files and we have download link no we don't have a download link so you can see we cannot download the die base from here the problem is even if you can download you know if spring provides the feature to download this that is if you don't know about spring it's ok we are just using spring in our application because I'm making this video so that I can work on string in future on this in the success of tutorial but people who are not concerned about spring they are they are only watching this video just to learn mavin so it's ok you might be implementing spring using maven you might be implementing hibernate using maven so everything is almost same you just have to deal with this part ok so it doesn't matter if you're walking one spring or not so come back to this spring parts ok when you talk about this download file so even if you can download this putting libraries maybe in future you're downloading the current version which is for maybe in future you have five so again you have not going to establish by yourself right so as our daughter / you have download all the reviews what if you can just mention someone in application that I want split I will use and someone else you know but not you maybe someone else a software in your system which will download all the required libraries and that someone is mavin what you have to do is you just have to use this type of text in your application automatically to download all the required Java Java files for spring not one all that's the advantage so how to use this part in your application so we do not have to create a normal web app McDonald codes our application we have to create a mavin application so for that we have to click on new with equal click on another by default when you create an application you always choose Java project but this time we'll choose Miami project because we want to create a moment project we'll click on next it is asking for the default work location and I will keep it as default which is checked if you click on next there are lots of options so you can see a term here which is archetype so as we have discussed in the last video so archetype is just a template of your project so let's say you want to build a co java application so you have to choose archetype you have to create our web application so you have to choose a different talk type so you can see if you want to create a web application you have to choose this archetype which is mavin - archetype - web app in this I will be using a co-chair application so I will be choosing this one which is mavin up type QuickStart so QuickStart will give you the coach of application so if you think we don't we have only this number of options and the answer is no so you can also click on all catalog so as soon as I click on all catalog you can see something is happening here we just tried trying to download all the archetypes available in the remote server okay so mavin is a network ready applicant work ready framework so whenever you walk with mavin you have to make sure you have proper internet connection enabled so I will not yeah so you can see I we have lots of Ark types available so if you want to work with App Engine if you want to work with AWS for everything we have a different octave available so you can see this is App Engine we have lots of of types here you rather than all the sub types doesn't matter so we have to choose the next one which is internal so this is internal archetypes which will choose nav and archetype we start and then we will click on next so you can see we have a group ID so basically group ID is your package name so we will say group ID is just a comm dot nubbin and we'll make this application named as a telescope ok that's my application name so group ID is your package name and then this artifact ID is your project name so it pack the package name combines the group ID is a confirmation of group ID at artifact ID which is common telescope and then that's it so we'll click on finish so click on finish it will create a project ok and then you can see if you expand this maven dependencies you already have a jar file here ok now from where you're getting this jar file so this document is coming from the remote server but hold out every time you create a new application the jaffas will be coming for node remote application since already have created a project in which I have J unit so what your maven will do is it will create two repositories one will be the mote repository second will be the local repository the remote repository will be on remote server and the local repository will be on your machine now how to check waste anymore trap AHS Ettore so it is giving the path so it is users knowing it's my user account name and then the folder name is dot m2 which is by default hidden folder in m2 folder we have with a positive and it positive we have the type of library which is where is the problem it is Ju 'not and then J unit and the version 0.8.1 okay so just to confirm let's see where it is where the file is so I will open my terminal so if you are using Mac or a Yonex so you can just open your terminal and type LS and you can see we don't have any folder called as dot - you say dot M - so what we can do is we'll say clear and we say LS v 1 a so as soon as you say LS - a you can say you can see there is a foldable dot M - so again that's a clear we'll say LS not LS we'll say CD dot M - so you are so currently I am - M - folder and we say LS just to list the folders I have a repository folder let me go to deposit tree LS I have all this folders here so you can see there's a generate folder so say silly J unit LS I get a gigantic folder so say J connect LS and then we can you can see we have two jar files one is three point eight point one and then we have three point eight point two so maybe some you know maybe last time I have created a project using the latest Java file which is three point eight point two but will not well have been Chennai which version I want to use and which jar files I need so in this first structure you can see there is something called as p om dot xml so the main part of mavin this this valve is p om dot XML so you can see all your configuration in this file which is Bo m dot XML now also call is formed or XML now in this you have to mention something you have to mention the group ID I can you to Detroit all this thing when you create a project you will get everything so you will get a group ID you will get the artifact ID and the packaging time so if you're creating a job application it will be a jar file if you are creating a web application it will be a wire file next of this then this is very important for you this is called a dependencies now whenever you put in an application into an application if you want to use any third party API so you have to mention that dependency here so if you want to use RJ unit in your project so yeah to mention this dependency since you are mentioning a group idea j-unit artifact ideas J unit and then version 0.8.1 that's why you are getting this one how about let me do some experiment let me write three point eight point two so against it says building a workspace and then it is it has changed three point eight point two because it was already in my local shop local local depository let me know some expired oh no even that exists three point eight point zero so if I say you can say it takes some time to build an adder so if we don't have anything called as three point eight point one or eight point zero maybe just a wild try I have not done this experiment before so I might get an earlier so I'm getting in these others so we don't have current available three point seven point one we have three point eight point one at the point eight point two okay so that's how we have to create this three part this generate here now the next part is you have to when you expand this folder SRC so you can see not this is also not respond this SRC so in a sense if we have two folders one is main and test so if you expand main you have Java so I hope you remember the package name which is comm dot nothing dot then is Co if I expand to you I have a file which is app dot Java and by default you can see we have something called as HelloWorld awesome right so you type right enjoy like this where it is you will be getting the basic code by itself and then this is a better structure so the advantage of using map in here is you get a project structure you also get all the required dependencies but hold on I want spring a breeze now how to get those libraries x time easy just open your palm file so you can see we have a dependencies tag here and then tin that dependencies we have a dependency which is generated how about if I add one more dependency now how to do that just go to spring website and just copy this dependency as we have done we have navigated this part in the shuttle tutorial so just copy the dependency go to eclipse and paste and see the beauty of my oven now so you get all the required jar files right and it is everything is coming from the remote server I can since I have done this application before I am getting all this from the local repository so if you are doing for the first time it will download everything from the remote repository it will take some it may take some time from 20 seconds to 1 minute depend upon internet speed or maybe 10 seconds if you are using a high-speed Internet since I already have this into my local repository it doesn't take much time simple so this is how you have to create a simple mavin application so the next part will be talking about how to implement spraying and how to achieve dependency injection so I hope you have laug liked this video so do thumbs up you can see the bottom side it is a thumbs up button and do comment if you have any doubt I will try to resolve in my next video so thank you so much for watching and do subscribe for further videos
Info
Channel: Telusko
Views: 296,645
Rating: undefined out of 5
Keywords: spring, maven, example, framework, built, tool, application, libraries, web, how, explain, hibernate, structs, simple, easy, navin, reddy, to, tutorial, dependency, injection
Id: uEYjXpMDJiU
Channel Id: undefined
Length: 12min 4sec (724 seconds)
Published: Mon Dec 28 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.