IntelliJ IDEA Beginner Tutorial | How to create Maven Project

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this beginner's tutorial on intellij idea in this session i am going to go very basic step by step and we are going to learn how to create a maven project on intellij idea and do not worry if this is the first time you are creating a median project or using intellij idea i will go very basic step by step i am raghav and you can find all my work on my website automation step by step dot com and today we are going to learn how to create a maven project from scratch on intellij how to add dependencies in pom.xml file i will also show you how to run different phases in a maven project lifecycle and throughout this session i will show you some keyboard shortcuts on windows and mac operating system so with this let's get started and let us see the first step to create our maven project we have to open intellij and then go to new project and select maven so i will go and here on my windows system in the last session i have downloaded the zipped folder for intellij and here i have unzipped it i will go to the bin folder and i will navigate to the intellij idea application and double click on this exe file now in case you have installed intellij as a software on your system you can directly start it so once you have intellij idea started you will see this window in case some project is already open you can first close the project and then you will find this window so here you can go to uh projects here and then go to new project now in a moment i will change this theme to a lighter theme so that it is very clear to you let me first click on new project here and after this you will see all these options so we have to click on maven here and from here you can select the jdk that you want to use for this project by default it will show you your system's jdk but if you go to this drop down you can select a different jdk you can add another jdk if it is already present on your system you can navigate and browse to the folder or you can also download a new jdk i will go by default whatever is available for me as of now and then we have create archetype or select archetype i will skip this and go to next and here i will have to give my project name so i will say i can give any name here i will say my maven project and then you can select the location where to store this project here if you want you can change this you can browse here and change the location i will go by this location and then if you expand the artifact coordinates here you can give a group id now group id is usually the name of the company or domain then we have artifact id which is usually the project name and then version so if you want to change this you can change this and then say finish and this will create a maven project on intellij and you can see the project is created and it will load the project here and you will see here we have the project structure or the project window and here we have the pom.xml file and in case you do not see the project structure here you can click here you can find this project tab here you can click here or you can also use a keyboard shortcut you can say alt plus one on windows or command plus one on mac so if i go here and say alt plus one you can see it now shows me the project window or the project tree here and in the project you can see here if i go to src i have main and test folders and then i also have the pom.xml and here you can see the maven window again if you do not see this you can always click here here you can see a maven tab you can click here and it will show you the maven window or you can press control and e key on your keyboard that is control e and it will show you all the recent files and here you will see maven if you click maven it will again show you this maven window here now let me change the theme the background so that it is very clear to you i will go to settings here and from the appearance i can change this this is darkula i will say intellij light and i hope now this is very clear to you so you can see all these we have the project here and then we have the maven window here and this is our bomb.xml file that i have opened from here so now we have done step number one now we have to add the maven dependencies or the external libraries in our pom.xml file and for that we have several options you can go to your pom.xml file and click on the menu code and go to generate or in windows you can press alt plus insert in mac you can press command plus n on your pom.xml file so i am on my palm.xml file let me close the maven window and now here i have to create dependencies section so i can either go to code and say generate and you will see dependency here i will click this and then i can just search for dependency the shortcut is i can press alt plus insert so if i go here and say alt plus insert again it will give me the dependencies let me go by the code and generate and i will say dependency and here let me search for some dependency like junit and you will see it will show me all these options from where i can get junit so i will just get this one and say add and you will see it has created a dependencies section and added my dependency here so everything is added and as soon as you will save your project the dependency or the libraries will be added so i will save and it will download and add all my dependencies here you can also see the external libraries here so all the external libraries you can find here and then once you have done this we can go to step number three so you can check the dependencies added on the maven windows or on the project window so on the project window you can just go and check the external libraries or on the maven window if i click on the maven here and i expand the maven project and here i can go and check the plugins and i will just go here lifecycle and let me just click on install so that any dependencies if it's added in pom.xml will be downloaded and we can see if everything is working fine so you can see as i double click on install it has started the maven command and it says build success and now you can see here i have also got a target folder and this is external libraries and here i can see all these jars are here so you can see the jars here the site resources everything is here so if i go to resources you can see all these options here and then you can see all these reload maven project option then we have options for generate sources and as i clicked on reload project you can also see the dependencies and here i can see my junit dependency so this is how you can check the dependencies added and i have already shown you this shortcut ctrl c to navigate to the last file and if you want to focus on a particular window and hide the other windows you can press shift plus control plus f12 so let us say i want to work on this file i will click here i will say shift plus control plus f12 so i will say this and you can see it has hit all the other windows are now hidden and i can work here i will again press the same key combination to come back and then step number four is run maven project by selecting any life cycle phase from even window which we have already done so if you go to this maven window and go to lifecycle you can run any of the phases here which we have already done and if you want to close the project you can go to file and then click on close project and this will close the project so this is how you can create a maven project on intellij i hope this was very useful for you if you have any questions or any doubts do let me know in the comment section below and i will see you in the next session thank you for watching and never stop learning you
Info
Channel: Automation Step by Step
Views: 134,531
Rating: undefined out of 5
Keywords: how to create maven project on intellij idea, intellij idea maven beginner tutorials, how to add maven dependencies, how to add maven dependencies in intellij, how to add maven dependencies in build path in intellij idea, intellij idea quiz, maven quiz for beginners
Id: dxn5DsMWhGY
Channel Id: undefined
Length: 9min 22sec (562 seconds)
Published: Tue Aug 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.