Maven Full Course - Learn Maven From Scratch In 2 Hours | Maven Tutorial For Beginners | Simplilearn

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Maven is usually not used to build C#, or Ruby projects. Maven's domain is more or less Java only.

Do not recommend to use MAVEN_HOME or M3_HOME those are neither needed nor useful. Only adding the bin directory to the path and you need JAVA_HOME. That's it.

The inheritance order is not correct cause you don't inherit something from a settings.xml file. And neither you inherit something from the command line... Maven does not check for every build if a newer snapshot is available. This is defined by the update policy which can be configured in `settings.xml´ which is by default 24 hours . You should not mentioned system scope cause it's deprecated already and if you use it you will get a WARNING in your build. They have nothing to do with the information about the provided JDK (This is simply wrong). You should not use system scopes at all. The JDK does not provide artifacts which can be consumed by Maven in general.

Optional dependencies are intended for other things and not related to divide a project into sub module or not.

If you exclude a dependency you can only exclude the direct dependencies of an artifact. Based on your example. Project X depends on Y and Y depends on Z. Than you can only exclude Y from the dependency but not Z (This will happen indirectly.) . So in the end you can only exclude nearest level of transitive dependencies.

The settings.xml does not contain the central location you can overwrite it if you need to like. This is done usually if you are using a repository manager.

You always derive from the super pom as you do in java and inherit always from Object. You are mixing concepts. The super pom is defined by maven and can't be changed. What you mean is a parent pom which you can define yourself and distribute in a corporate environment where each project can derive from.

👍︎︎ 3 👤︎︎ u/khmarbaise 📅︎︎ Aug 17 2020 🗫︎ replies
Captions
maven is a devops build tool that is chiefly used for java based projects it helps in getting the right jar files for each project hi guys welcome to this complete maven tutorial by simply learn in this tutorial we will be covering all the major topics related to maven we have anuj with us to take us through all these critical concepts and several hands-on demos throughout the video course so let's have a look at all the topics we will be covering today we will begin with understanding why do we use maven then we will see the basics of maven then we shall see the process of installing maven on windows ubuntu and mac we shall understand several basic concepts of maven and the maven lifecycle next we shall have a look at all the advantages of maven and finally we will have a look at the top maven interview questions these maven interview questions will help us understand the structure of the questions that could be asked in a maven interview so without any further ado let's get started but before we begin make sure you have subscribed to our youtube channel and don't forget to click on the bell icon so you never miss an update from simply learn now we will be talking about that how exactly we can make use of maven here in performing various kind of operations whether it's a build compilation various kind of stuff there so let's talk about it why exactly we use maven here now meven is something which is a kind of a build tool which is there for most of the job-based projects here so this tool also helps us in building up the source code by downloading some couple of dependencies these dependencies are something which is being configured by the developers which a developer feels that uh the project is dependent on and he requires those dependencies to be downloaded so uh this tool is specifically used to build and manage any kind of a job-based project whatever the complexity of the topic or the project is there so this tool will be able to handle that particular requirement or that project so it simplifies the uh day-to-day work of a java developer and helps them in their projects for performing daily to daily activities right now maven also helps us in getting the uh specific jar files for each and every project so if you are going you can pretty much make a jar file var file or er file any kind of a package mechanism you can follow for your maven day so to download the dependencies we don't have to actually go to the official website of each and every software you can easily get it uh the dependencies of each and every third party band race on the mvnrepository.com this is a website which is present on which if you visit you will be able to download the dependencies which is required by your project or by your specific project over here so it totally depends on how exactly you want to download and you want to get together a specific repository over here so mvnrepository.com is the one if you visit you will be able to download and go through all the jar files dependent jar files as independences which you require for your current project right so now what exactly is a maven all about so let's see on that part so maven is a popular open source build tool which is uh developed by the apache group and the primary uh ownership of this tool is to build publish and deploy several projects at once meven is written in java and it can be used to build projects written in c shaft scala ruby etc so apart from java these are the different programming languages or the tools which is supported by the maven here for performing the build activity so the tool is uh used for build and management of any kind of a jar based project it simplifies the day-to-day work of a java developer and helps them to automate most of the compilation or build perspective tasks on the projects right now meven is a kind of a bomb-based project so uh it also known as an project object model and it focuses on of simplification and standardization of the building process in the process it take cares of all the followings here builds dependencies reports distribution releases mailing list so all these uh things are being taken care as in this particular process here and ultimately it's an availability inside the maven that how the overall build process needs to be automated and standardized here so all these particular mechanisms is can be followed as such over here so that we can have a good standards and the simplifications implemented as such here now in this one we are going to talk about that how we can work on maven installation on windows and ubuntu platform here so first of all we'll do it on the windows platform here and we'll see that how the installation really works so for this one i will be doing the installation into my local system now before even going for maven maven is in kind of a build tool which is available there primary for performing any kind of build automation for the java based projects now since it's used for java we also require the jdk installation onto our system so for that both of the installations we will be covering over here and we'll see that how the installation really works as such over here right so before even going for maven uh we have to install the jdk onto our windows machine so that we can proceed with maven because maven requires the jdk installation should be there now there are two ways of jdk installation either you go for the exe file or you want to extract the binaries of jdk to a directory and then set up the java underscore home path for that but if you are using in the executable that will perform the path configurations for you also so in that case you don't have to reconfigure it again and again so that's what we are going to see here so first of all we will try to do the installation of jdk so for that we'll go to the website of jdk and then we have to click on this one to access the maven installations part here so that's what we are going to do so let's proceed and let's open the chrome and try to go through these two urls so that we can do the installations one by one so here i have to just search for jdk8 download so uh it will show me the url for oracle.com so here you will get the jdk for the different platforms for different operating systems now here what you can see here that uh you have the configurations in which you have the jdk installation so we have to so here i'll go for the windows 64 version because that is something i will be using to do the installation so this is the complete executable link so here you can download so we are downloading the sdk a to u 251 so just search for windows 64 yeah this is the one so let me click on this one let me quickly log into the web page so once the login is done you will be able to see that it's trying to download the exe file so that was for the jdk for the java now for the maven i am going to go for the maven download over here so in this one the maven repo link is there maven dot apache.org is the link for this one now here we have the different options you can see here that uh the binaries if like archive is there and sources archive is there so depending on the installation which you want to perform you should be able to download that file and it works there so let's first install the jdk portion and then we'll go with this one so we'll click on this one also anyways because uh it's something we have to anyways do it so we'll click on this so that this maven is also getting started install or downloading over here so once both of them are downloaded we will proceed further with the setup so let's wait for another one minute to do this one so the apache maven is kind of uh downloaded over here so we wait for the jdk download also over here so next five ten seconds only left out so first jdk will be there and then maven installation configurations will be there so for me when we just have to extract into a directory and give the envian home path into the properties uh into the variable so that it can pick it up over there okay so we have to extract the zip file from a1 give the path and then we will check with the maven command whether it's working fine or not so let's try to install the executive so we'll open the directory where the executables are there so first of all we'll install the jdk so we'll double click the installer for jdk it's all for around 200 mb so the complete jdk will be installed so we have to just go for next now when you go with the installer so usually the java home parts and all that stuff is already configured so you don't really have to change the passwords or java home any kind of variable you have to put it up all those things will be automatically cleaned up it's running the installation close so then we have to extract the maven so we have to extract this directory because here the maven complete executables and libraries are there so we just have to extract it and place into a directory so that we can further on use it and access the path so once the access is done yep so this is done there so i can rename it to like maven so i can rename it like to ask me one and i can cut it down and put it into the c drive here now this is the maven home path which is going to be there right so all i have to do is that i have to close this one and this one and this one and this so what we have to do is that we have to really go to the system properties so that we can extract it so i'm going to open the system properties over here properties now here the advanced system settings now in this one we will be setting up the paths the environment variable will go now here if you scroll down you will see all the different parts which is available there as such over here now if we want to see that if the java is fine or we require for jdk also so all we have to do is that we have to open the cmd prompt window r we are providing so using the window r i'm opening the run window where i can say like cmd now in this cmd i'm going to say like java hyphen version so java is there so which means that we don't have any problem as such now i'll just go here and set up a new one called mvn underscore home so here the same path so you can browse for directory also but i am using the ambient home over here in this one now i have just added that and in the path variable in the last we have to actually add the bin directory also so that uh whenever we run the mvn command so that should also be resolved so mvn underscore home is not the only variable which you will be configuring in fact you will be confirming the path variable also that you can go ahead and put up a new directory entry for the cmd here so cmd till the cmd directory you will go there and whatever the executable is there you should be able to resolve that so for that again you have to open the window r cmd prompt java hyphen version and then you can run mvn iphone version here when you run the mv and hyphen version it will let you know that which particular java runtime you are using 1.8.0 underscore 251 that's the same one which we have configured and it also let us know that where exactly the executable is there and we can now proceed further with the execution of the maven build so you just have to check out your source code or go to the directory where source code is there and you can run the mvn clean install so that will ultimately go for the build process so this is the way that how we can do the installation of maven on the windows platform now since this is done now we will go ahead with the second installation where we are going to do the installation of maven and jdk on to the open to machine so for that we will log into the particular cloud lab of simply learn lms so let's log into the lms here so now we are going to do uh the installation of jdk and maven on the ubuntu virtual machine here so for that we will log into the lms so let's log into that so this is the uh elements over here here i have already started the lab here so all i have to do is that i have to just click on this link here so it will open the lab into a new tab it's a gui mode of ubuntu server so which we will be using to configure it so uh here uh first of all i can open the chrome browser also so let me open the browser here so that i can download the maven executables as such over here so jdk we can do it using the package installation so using the app executable we will be doing the installation so i have to just open the terminal here so once the terminal is opened you have to log in through the root id now why we require root id so that we should be able to do the package installations and other configurations so that requires root access now once that is done you have to run the particular app update command next you have to install the installer so the oracle installer we have to install now uh once the setup is done so let's down install the latest package over here for eco oracle iphone java 14 hyphen installation so this will install the jdk 14 over here so for that configurations now at the same time we'll go for maven download also so here uh we'll go for download maven so this is the tar file for executables so i'm going to copy this url here and over here we'll say yes yes yes so now uh the java should be configured and could should be set up over here in this one so what we really need to do is that we need to run the java command to see that if the installation is done properly or not so uh let's open the terminal again another terminal so that i can perform these steps related to maven so i have got the url so i am going to the opt directory which is always an optional directory where we can do the setup and all those configurations so i am going to run the wget command and then the url which i have downloaded so this should uh download the tar file over here of maven now once that is like done so i have to extract it so uh tar hyphen xvz f and the entire file name this is a target zip file so i have to use tar hyphen xp zf parameter over here to extract it now uh what exactly i have got i have got the apache maven directory over here so i am going to rename it in order to rename it what we need to do we need to actually go for uh the particular move command so move whatever the existing folder you have and then i'm going to rename it with the maven directory now once that is done i'm going to the maven directory and this is the path or maven underscore home path which is available as such over here in this one so here all the bin directories executables all this stuff is there so now i can use it like mv underscore home and the same configuration just like we did in the window so here also it the same process we have to follow so java hyphen version should be let me know that which version is deployed so 14.01 version is deployed over here so for java i do not don't have to set up the path again here because i am viewing for the installer so i don't have to set up the path right so for maven now what exactly i have to do i have to go to the edc profile d now here i am going to put up a particular file now here you can see that we have the jdk a file here which means that the path variables and everything is configured as such over here so you can see that java underscore home path all these variables are copied here so i'm going to also create a same file similar to this one here but in this case what i'm going to use it that i'm going to remove some of the values so i'm going to have some of the parameters added so in order to do it effectively i can do the echo command so that i can copy the things from here and i can simply put it up into the file here so i'm going to have the path variable added up over here now why i'm putting up the paths because it's the same configuration which we did over there also so opt slash maven slash pin so all the pin directory should be added to the specific path variable so i'm just trying to create a file called maven dot ss just like a jdk dot sh over here i'm also creating similar kind of file over here called maven dot sh now i'm not going uh in the vi mode or other editors because i just want to make you understand that how i'm copying it the content i'm taking the jdk.sh as in reference and putting up the details over here in this one and then i'm going to export mvn underscore home over here which is related to like opt slash maven so this is what we are going to put up over here and then maven in the end me when this is the file which you should be having now why we are using it because of the fact that it's being used or it will be utilized in such a way that you can perform the changes or whatever configurations you want to perform this will help you to set up the certain parts like a path and ambient home so that you can run these scripts as such over here so i'm going to give the executable permissions to this one and that's it so now what exactly i have to do is that i have to do the source here profile dot d maven once that is done i will be able to run the mvn hyphen version over here and the jdk part is already open so it's going to refer to that part so this is the way that how we configure the mi1 and the jdk specifically on the ubuntu virtual machine so pretty much that's it for this demo in this demo we primarily talked about that how we can do the installation of jdk and maven on windows and how we can do the similar task on the maven on the ubuntu virtual machine also here hello everyone welcome to this demo in this demo we are going to talk about it how exactly we can do the installation of maven on the mac operating system so here we are going to talk about it how we can do for a specific setup where we can do for the installation of maven in a mac operating system so let's see so there are two ways of doing the installation here first is through the brew executable on the mac now this brew utility on mac is just like app or yum utility which is present in most of the environments or most of the platforms here but here we are using this brew to do the installation of maven on the mac operating system and again the next one is just in a particular mechanism where you should be able to have these setup like you can download the binaries from the apache website and then you can export the m2 undiscord home and the path variable so that you can start using the maven executable so we'll talk about these things and we'll see that how exactly we can go for this setup so let's login uh to a particular machine or mac operating system so where we will be able to do all this activity so this is the mac system which we have here now in this one what we are going to do is that we are going to open the terminal so we are going to open a terminal here so this is my terminal so usually in mac you don't require any other mechanism so the inbuilt terminal is more than sufficient for doing this stuff because it's similar to a linux based platform here so i'm going to run the command here so first of all i'll just double check that if my brew executable is working fine so i'll just run the brew help command to see that uh if my brew is working fine as such over here in this one now i have the command called brew install so that is a command which we need to use now in this one we have to actually give the specific package which we want to install so we will say like brew install maven so it will download uh the uh specific executables on the system from the website it will download the maven executables so it will take some time but ultimately it's trying to download it under the particular tar file so you can see here that it's downloading the 3.6.3 dar file over here so uh i can see that the installation is done so the 3.6.3 version should be installed over here so when i do like maven mvn under hyphen iphone version over here so you can see that the 3.6.3 version is deployed as such over here now this is something which is done with the purely command over here called brew which really helps us to do any kind of package installations not only maven other packages also can be installed pretty much with the help of this executable now in order to see the manual stuff what we really need to do is that we need to actually clean this uh specific installation so that i should i will be able to show you the manual installation also over here so what i'm going to do is that i'm going to run the command called brew uninstall maven so that the maven should be removed from your system so we are just trying to remove the maven from here and uh you can see that the maven executable is not working as such over here so which means that the maven is uninstalled in this case but why i have uninstalled here so that i should be able to go ahead and download some custom maven over here in this one so i have opened the browser here so i'll go for the maven executable so we'll go for maven download so that we should be able to download a specific the executable here so i'm going for this directory so here uh 3.6.3 version same is available here so i'm going to download the bin.gz which was uh the file we have so this is also a kind of a linux platform right so that's the reason why uh here the tar file should work perfectly fine so here i'm going to the opt directory where we can have all the optionals related packages so if it is not there so i can create a directory called slash opt so i can log in with root so if you don't have the root access so you can go for the applications in the applications you can actually create a directory called maven so here i can go for maven yeah so here we will be downloading the var file here so the uh tar.ganji file we are downloading over here so i'll give the path here so once the var file or wkate command i am using to do the installation but sometimes the wwg is not available so i can go for the brew install wget also if that package is available on video the installation will be done so we'll try to do the installation using grublucat so that we will be able to get a tar file generated or downloaded there are other ways also you can download it from the browser also yeah you can go to the browser and here you can actually click and download it and then you can transfer it locally to this uh specific directory also so both the possibilities are there but i'm just trying to download the double gate command so that it will be easy for me to do the setup and to do the download over here so i'm going to run the same command again so it will download the tar file so this is the tar file which is available over here so i'm going to extract it over here so once the extraction is done so i'm going to rename it like to apache maven so that i should not have any kind of versioning or these kind of parameters over here and the apache data maven hyphen this star file i'm trying to remove as such over here so this is what i have got as an end result over here now this is the current directory in which i have these uh applications and these setups going forward over here so if i run the mvn hyphen f1 version command so that will not be giving me any kind of output over here because still i have extracted the tar file but that is not the activity is not complete i have to exactly set up some environment variables so that i should be able to run this ambient command so what i really need to do over here is that we have to export certain variables application slash me1 apache mi1 so this is the home directory which i'm trying to configure over here and then next thing is that path variable so i'm going to have we are going to carry the path variable with the folder so i'm going to have the folder structure here so the bin directory we have to provide so i'm going to copy here and paste and then i'm going to carry it with the bin here so now my environment variables are established so my mvn hyphen iphone version command as you can see here is that uh you know it's being picked up over here but it's saying that the particular java runtime is not available so i can go for java view install java so that should be enough there to install a java package there so you can see that it says that it's already installed so and up to date so that's the reason why it's not able to do the installation so i'm going to reinstall open jdk because what happens that when we do the installation some environment variables related to java should be formatted or should be extracted over here right so as you can see that uh here it's saying that if you want to really use the executable of java you have to concatenate the path like this so let's run that and uh then we can see that the particular executable of java will also be find out over here so java hyphen version showing that yes it's available there and now my command should be able to show me that yes it's working fine the gdk was already installed but the problem with that is that since it's installed into a particular location so you have to actually override your path value so that you should be able to see in that directory and find out the java executable so that i have got by doing the installation i got the command over there in the output saying that this is the installation which is done and now you just have to extract or you have to just you know put that bar directory into the specified uh path variable and that's how you got the maven and java both command lines working over here so this is how you will be doing the maven installations all together how the overall installation of maven and the jdk really works on mac operating system now what exactly is a maven repository all about so maven repository is uh something which is a kind of a directory or it's kind of a location where we have all the jar files packaged all together in a single location so depending on the software which you want to download the dependent java files can be downloaded from there so the metadata refers to the palm files relevant to each project here this metadata is what allows maven to download the dependencies now there are three type of repositories from where we can download the dependencies the first one is the local repository second one is the remote repository and the third one is the central repository so these are the primary three type of repositories which is available there for a specific maven over here so whatever repository you want to follow you want to access you can pretty much access it and you can go with that right now the local repository will be primary present onto your pc that's the way that how it's present there and the uh particular remote repository something which you can store on any remote machine or remote server and the central repository is something which you can have it onto the internet so usually the central repositories is something in which we can actually host our different kind of dependencies and the jar files over there so local repository on the machine of the developer where the project material is saved so all the particular dependencies jar file will be available on your local machine remote machine is the location where you can actually store all your particular dependencies from where you can download these dependencies whenever you require it so this and repositories work similar to the central repository whenever anything is needed from the remote repository it's first downloaded if into your local repository and then it will be utilized so if you feel that the dependency is something which is not there in the local it will be first downloaded from the remote repository and then it will be utilized or will be referenced onto the local machine there and central repository is refers to the maven community repository there where you will be able to see each and every dependency present on that repository so maven downloads the repositories from here in the local repository whenever they're needed or whenever required all these dependencies are cached locally from where it will be referenced in the next or you know whenever we want to refer that we will be able to do that particular reference easily on that part so this is the way that how the three uh particular repositories or movement repositories really helps us for performing various kind of automations as such here right now what are the basic concepts of maven here so some of the couple of basic concepts which is present in maven is like for the first time we have the project object model so project bomb reference to the xml file which has all the information regarding the project how this particular project should be built up how the different build process should be automated there it also has a description of the project details regarding the versioning version information is also stored as such in this xml file in this particular form reference file as such over here the xml file is which is there in the project home directory so maven is something which search for the pawn file in the current directory if it's able to find that particular palm file so it will execute or it will proceed with the build step otherwise they it will hold there itself so this pawn file is very important because it will act as a kind of a built script and primary the maven tool will be able to process each and everything which is configured as such in this specific xml file there and according to that only it will function or it will proceed further right now second thing is the dependencies and repositories so dependencies are usually refers to the java files so the java libraries which we need in our into our particular project so while uh working on the project we may be having the dependency on couple of dependencies so these dependencies we have to actually download or we have to actually refer and once these a particular information or these details are referred so what will happen that uh we need to download these specific dependencies from the particular maven repositories so if their dependencies are not present in your local repository then maven will try to download it from the central repository and cache it into your local repository but first of all it will look on into the local repository and if it is not present in local then it will go to the remote or the central repository then we have build life cycles and phase and goals there so build lifecycles consists of the sequence of build phases and each field phase consists of sequence of goals here now each goal is responsible for performing a specific task when a phase is uh running all the goals related to that phase and its plugins are also used to following the compilation preparing the artifacts downloading the dependencies all different things being done by the plugins here then we have the build profile so build profiles refers to a set of configuration values now generally we have the generic build process for all the environments all the particular code base there but sometimes we do have some kind of a differences there so that is where we can go for the profiles because a specific profile can have its own configuration and whatever it's required for the build process we can have different different configurations stored inside the maven build script here then with different build profiles are added to the palm files and which enables the different uh build as such here so depending on these profiles we can actually decide that how we need to proceed with the build process and how the different kind of build order missions needs to be performed here then a build profile helps in customizing the build for the different environments so that also we can perform as such while performing or while working on the different components and the different management here so a build profile is something which you can configure you can utilize and depending on that build profile we will be deciding whether to proceed further or how to decide on that particular factor so these are something which we need to take care or we need to work according to which we can decide that how the specific configurations and specific automation needs to be performed here now usually when we go for the um even there so we have to use some couple of maven plugins now the goal of using these uh specific plugins is to automate some of the basic stuff like compilation creating the var file creating the java file so when we are using the plugins we don't have to configure the steps or write the steps that how these uh specific plugins should be installed or should be referenced it's ultimately the internal configurations which we are looking forward or which we are using while working on these specific plugins so you can download some couple of plugins using which we will be able to decide that how a specific goals needs to be achieved here so maven has its own standard plugins that can be utilized so if you know want to go for a custom one so you can do that but pretty much you can go for the default one and uh you can pretty much have some specific goals executed with the help of these build now next thing is the maven architecture so uh in maven what happens that uh let's talk about the basic architecture of maven here so the maven executable when it's deployed so it usually uh reads the palm.xml file which is the build script here now once the specific found xml file is being read out so it will uh process the components it will uh you know download or it will process the dependencies plugins life cycles phases and goals and even the build profiles and if any kind of interaction is required so it will try to connect to the central repository or remote repository and according to that it will provide the information and provide the details as such so minimum repository is something which is very important because it's ultimately trying to connect to the maven repository and try to achieve the various kind of automation here so it's very important because ultimately it's trying to help us to go for the complete end-to-end build automation when we will go for a specific bomb based build automation so a movement executable read the pom.xml file then download the dependencies defined into the power xml file and that dependencies are cached locally from the remote or the central repository now then uh create and generate a remote uh report according to the requirement and execute the life cycles phases goals plugins etc so it will process the pawn rectangle file then and whatever the plugins and goals or the life cycles which is configured there step by step each of them will be executed into a sequence here now let's talk about the overall build life cycle of the maven here so what happens that uh the maven build lifecycle is something which is a kind of a collection of different steps there and this is something which is followed to perform a build automation for a specific project so they are pretty much three steps which is being done so first one is the default so it handles the project deployment there second handles the project cleaning which is a clean there and then we have site so it handles the creation of the project sites documentation there so these are the three built-in particular life cycles which is available there at the beaver level which you can utilize to perform a various kind of particular steps execution for your project right so the build cycle has the different build phases or stages there because when we are performing a build a variety of things needs to be performed over here so the first one is the compile then test compile is there so compilation is there for the source file and test compile is there for the test cases test will execute the test cases package will package the bundle then we have the integration test to run the integration test cases then we have the verify then install goal is there and the last one is the deploy which is there to deploy the artifacts to the artifact tree so all these things are the different phases and the stages which is being followed as per a specific build here so during these builds these are the different phases and these stages which we normally follow for performing the build automation now what is the exactly advantage of a specific maven here so that is something which we need to talk about that how the particular automation needs to be done or how we can actually go for the configurations where we feel that yes we want to perform or we want to take certain benefits out of the implementation of maven here so for that what happens that uh we have to see that the various kind of uh benefits the first one is that apache mi1 helps manage all the processes there such as building documentation releasing and distribution in project management here so the tool simplifies the process of project building it increases the performance of the project and the building process all together and the task of downloading jar files and other dependencies is also done automatically we don't have to indulge in any kind of download part as such manually over here right and maven provides easy access to all the required information so may 1 makes it easy for a specific developer to build a project in the different environments so we don't have to worry about the environment we don't have to worry about the infrastructure nothing is required everything is available there inside this package and you know depending on the particular you can write the source code on one machine and you can pretty much do the build on another machine and this is the reason how the build automation really happens on the first place because the developer is writing the source code in one location and the same code is deployed onto the particular or built onto this jenkins or any kind of build tool there right in maven you can easily add new dependencies so you must write the particular dependencies in the form file so if you feel that you want to download some particular dependencies so all you have to do is that you have to put that dependency into the specific palm.xml file there and depending on that the execution will be really performed and executed as a chair right so let's talk about the demo now so let's see that how exactly we can go for this demo and we can perform the various kind of automations so this is the virtual machine which we have here on which the maven is already installed so we can run like mvn so maven will be available as in three point six point three here now i'm going to run a particular command called uh mvn archetype generate here let me create a directory here our temp directory and to perform this activity over there so mvn arc type generate now once we run that so what will happen that it will uh download some of the binaries there because uh ultimately what we are trying to do is that we are trying to generate a new project like a maven project so couple of uh particular plugins will be downloaded by the maven executable so that it can achieve that particular execution so we just have to wait for downloading all these values now here it's trying to give us a particular attributes like it's asking the different attributes over here so what exactly we want to configure so if you want to configure you can provide that details otherwise you can perform or whatever the setup you want to perform now here it's asking for the version so which kind of version we want to follow so i'm going to follow like five here so i'll press five then a group id which is there so it's basically a kind of a group mechanism so i can say like com dot simply learn so that's the value which i'm providing here artifate id i can make it like a sample project or something like that uh i can do so that will be the artifact uh id which is there so version i'm keeping the same only so and uh yeah so package same here so i just want to create so i'll just provide the value called yes and enter so with this what will happen that a sample project will be created here right so whatever the artifact id you provided so according to that the project is created in this directory so you have to go into this directory and see that what exactly the files are created there so you have the power.xml file now this form.xml file when i open so you can see here that there are some attributes like you can have the values uh related to what version or group id you want to follow so this is a group id this is the artifact id so this is jar file by default you can change it according to your requirement then this is the version and if you feel that you want to do the changes to the name that also you can perform here so by default the junit dependency is added but if you want to keep on adding your own custom dependencies you will be able to do that now in this case if you run like mvn clean install so it will be considered as in particular maven project a palm xml file is already there present in the local directory so according to that the execution of the steps will be performed and according to that you will be able to get some desired values here so ultimately in the target directory you will be able to see that some couple of jar file or a specific jar file is generated here so you can see that in the target directory this jar file or this artifact is generated here so this is a way that how we can actually go for a generic one like a new uh particular project and later on you can depending on your uh understanding you can keep on adding or you can keep on modifying the dependencies and that's how you can get the final result there so that's it for this demo uh in which we have find out that how exactly we can go for a particular project preparation with the help of mvn executable welcome everyone to this topic in which we are going to talk about that what exactly is the different maven interview questions here now in this one we are going to talk about what are the different questions some couple of questions we are going to go through and we'll try to understand that what exactly the answers are now let's talk about the first question over here so what exactly is in maven here so maven is nothing but a kind of a popular open tool uh open source build tool which is available there now before maven there were a couple of build tools which was present like and and you know a lot of other legacy tools was present there but after that maven is something which was uh released as an open source tool and it really helps the organization to uh automate some couple of build processes and you know have some particular mechanisms like build publish and deploy of different different projects at once itself so it's a very powerful tool which can really help us to do the build automations we can integrate them with the other tools like jenkins and you know we can automate them we can schedule the builds so a lot of various advantages we can get with the help of this tool here it's primarily written in java and uh it can be used to build up various other kind of projects also like c sharp scalar ruby etc so all these other typical tools can also be built up with the help of this tool so this tool is primarily uh used to do the uh particular development and management of the artifacts in the java based projects so uh for most of the java based projects nowadays this is the default tool and it's already integrated with the eclipse also so when you go for a new wavelength project automatically uh it will be created for a java project you can use it for other languages also but yes default choice of java of of the java programming language is maven build tool only now let's talk about next question so what does the maven help with so may when apache maven helps to manage all the processes such as build process documentation release process distribution deployment preparing the artifact so all these tasks is being primarily taken care by the apache maven so this tool simplifies the process of project building it also increases the performance of the project and the overall building process so all these things are something which is being taken care by the specific maven tool here so it also uses the particular uh you know it downloads the jar files of the different dependencies for example if your source code is dependent on some of the apache web service jar files or some of the other third-party jar files in that case you don't have to download those jar files and keep in some repository or keep it in some lib directory you just have to mention that dependency in the maven and that jar file will be downloaded during the build process and will be cached locally so that's the biggest advantage which we get with maven that you don't have to take care of all these dependencies anywhere into your source code system so maven provides easy access to all the required information it uh helps the developer to build the projects and uh without you know even worrying about the dependencies processes or different environments or different because it's in a kind of a tool which can be used in any platform linux or windows so they don't have to do any kind of conversions so all they have to do is that they have to just add new dependencies and that should be updated into the pom file and depending on that dependencies the source code will be built up and they don't have to refer any kind of third party jar files so they don't have to play with the class bars during the build process so no customizations is actually required with this one now the next question is that what are the different elements that may one take cares of so there are different kind of elements which is being taken care by maven so these particular parameters are elements are bills dependencies reports distribution releases and mailing list so these are the typical different different uh elements which is being taken care by the maven during the build process and during the preparation of the builds here so all these things you can uh they can explore they can extract on that part and they can fully understand that how they can work on all these different different processes now next question is that what is the difference primary difference between the and and maven first of all both of them are primarily used for the java based project so and is the older version and maven is something which was launched after the ad here so and has no formal conventions like so which can be uh you know coded into the build.xml file there but yes the maven has convention so information is not required as such in the palm.xml file there so ant is procedural whereas v1 is declarative over here so and does not have any kind of life cycle so it depends on you that how you program the and there but maven is having a lot of life cycles there which we can configure we can utilize so the uh and related scripts are not reusable because you cannot reuse it and you have to do some kind of customizations in order to work on that but yes maven is not having much of the project related any kind of dependencies they can be easily reusable there because there is nothing about the palm.xml file it's just the artifact name and the dependencies which is uh something we can override or we can change and then the same palm.xml file we can reuse as such for the new project also so that is where the reusability comes into the picture now and is a very specific build tool so we don't have to there is no plugins as such which is available there you just have to code everything that what build process you want to prepare whereas in case of maven we have the concept of plugins which can really help us to understand that how we can make or use of these plugins so that we can have the reusability implemented so these are some of the differences which is available there between the and and maven here now next thing is that what exactly isn't palm file all about so palm file is nothing but it's kind of a xml file which is available there and it's have having all the information regarding the project and the configuration details so it primarily used over here that how the configuration needs to be done and how the setup should be performed as such here so palm technical file is the build script which we prepare uh you can prepare it uh using a particular component or you can have a particular mechanisms or if you feel that you want to have some kind of setup so all these things typically can be implemented can be done with the help of build tools so build tools can be really helpful for us to do the automations and it can really help us to understand that how some build processes we can automate with simply with the help of palm.xml file here so the developers usually put up uh everything inside these uh dependencies in the palm.xml file here so this is the file which is uh usually present in the home directory it's in the current directory so that once the build is triggered it will be picked up from that directory and according to the steps according to the content of the palm.xml file the build will be processed or will be created here now what i'll include into the palm file here so the different components which is included into the palm dot xml file here is the dependencies uh developers and contributors plugins plugin configuration and resources so these are the typical components which is a part of a permanent xml file which can be uh same form lot of projects you can do some customization and then the same pom file can be reused for the other projects also now what are the minimum requirement of the elements which is there for a palm for uh powered xml file so without which the pound xml file will not be validated and will will be getting a kind of validation errors so the minimum required elements are project root model version so it should be 4.0.0 the group id of the project the artifact id of the project and the version of the artifact these are the minimum things which we want to define so that we can understand that what kind of artifact we are trying to prepare or we are trying to create here so these are the minimum required elements which is required in the palm.xml file without which the validation of the palm file will fail and the build will also fail here now what exactly is the mint uh with the term called build tool so build tool is an essential tool is a kind of a process for building or compiling the source code here so it's needed or it's required for the below for generated processes if you want to generate the source code if you want to compile the source code you want to generate the source code you want to generate some documentation from the source code you want to compile the source code or you want to package the source code whether it's a jar file it's a war file or it's a er file so whatever the packaging mode you want to select you will be able to do it with the help of the particular build tool here and if you feel that you want to upload these particular artifacts to the artifact tree whether it's on remote machine or locally there so that also you can do it with the help of this particular build tools here so build tools can be helpful in doing a lot of activities for the developers now one of the different steps which is involved to install maven on windows now all you have to do is that you have to just first of all download the uh tar file from the maven apache maven repository there once that is done so what happens that you have to set up some couple of environment variables now if you download the java jdk using the exe file in that case the java undisco home will be configured automatically but if it is not available and you are not able to run the java command line in that case you have to set up the java underscore home and then similarly for maven you have to go for the maven underscore home that particular variable you have to configure now once that is done all you have to do is that you have to edit the path variable so the bin directory of the maven extracted a folder you have to put it up into the path variable and once that is done what will happen that you will be able to check the latest version the version of the maven over there if it is like some old version again you have to extract the latest version and do the steps all together again so these are some of the ways that in which you can actually go for the installation or the configurations of maven on the windows platform now what are the different steps which is involved for the installation of maven and ubuntu so ubuntu it's fine you just download the package of java jdk there once the jdk is installed over there what you can do you can simply go ahead and say that yes i want to search for a particular maven uh package which is available there so once the jdk is installed all you have to do is that you have to configure the java underscore home m3 underscore home main and disco home and the path variable once all the path variables are something which is configured then you will be able to check the latest version like whether it's a the version is correct or we are getting the standard version over here or not over here so that's the main mechanism that how we will be able to you know configure the maven on ubuntu here now what exactly is the command to install to char into the locals repository now sometimes what happens that we are not able to fetch like uh some dependencies not present on the uh particular central repository minimum repository or your artifactory repository in that case you have some third-party jar which we want to install locally onto your repository so in that case we can go for the uh but we can download the jar file there and then we can run the command called mvn install install hyphen file and then we are giving the path like hyphen d file where the path of the file should be provided now once that is done so what will happen that in the local dot m2 directory this specific artifact will be downloaded and will be installed here so this is a mechanism where you will be able to configure or you will be able to set up the artifacts locally the java file locally here in the local repository so next question is that how do you know that the version of the maven being used here so the inversion of the maven is pretty easy to calculate so all you have to do is that you have to just go for mvn and space hyphen iphone version the moment you do that it will let you know that what jdk or what java version you are using and it will also show you that what particular maven version you're going to use here so all that details you will be able to get with that particular command here now what exactly is the clean default and frightened variable here so these are the build cycles which is available there in within maven so these are the built-in build cycles so for clean what happens that this life cycle will help you to perform the project cleaning so usually during the build there are some files which is created into the target directory so the clean life cycle is essentially helping us to clean up all that directory all that particular target directory and when we talk about the specific default so default lifecycle handles the projector deployment that is the default uh lifecycle and site is something which is uh you know helpful for creating the site documentation you know it's kind of a life cycle which is available there so clean default and site are the different life cycles which can perform different different kind of uh attributes or different tasks here next question what exactly is a maven repository so maven repository refers to the directories of the package jar files that contain metadata now the metadata refers to the palm files relevant to each project so here you can able to get your artifacts uh stored there you can download these artifacts also during the maven build if you put up that dependency you will there are different kind of repositories which is available there one is the local repository one is a remote repository and one is the central repository so these are the different typical type of repositories which we have where we can store the artifacts also and from where we can download the artifacts also whenever required now the first one is the local repository so local repository refers to the machine of the developers itself where all the project related files are stored there now whenever we work on the uh particular maven so there is an in the home directory dot m2 folder is created now usually whatever the artifacts downloaded from artifactory or from the maven repository it gets cached locally there and once it is downloaded next time it will not download the same artifacts or the same dependency altogether again so this local repository is something which is available locally on the developers machine only so it contains all the dependent jars which a particular developer is downloading during the maven build now remote repositories refers to the repository which is present on the server and uh with from where we will be downloading the uh particular dependencies so the when when we are running the movement build on a fresh machine so usually over there the local repository does not exist so in that case what happens that the dot m2 directory is empty but the moment you run the build what will happen that the artifacts or the dependencies will be downloaded from the remote repository and uh once it is done once it's uh downloaded it will be added or it will be downloaded cached locally there and it will be uh helpful in the future run so that will be considered as a local repository because all the artifacts all the dependencies are downloaded there and central repository is something which is known as the maven community where all the artifacts is available there so usually we cache or we mirror these central repositories as our particular remote repositories because it could be a possibility that these remote repositories are something which we are hosting into our organization and central repository is something which is available centrally for everyone to use it so these are something you know some kind of repositories where each and every artifacts will be stored and anyone will be able to have the access to these particular artifacts here so these artifacts are every artifacts every open source uh artifacts is something which is available over there to these central repository now how does the maven architecture really work here so the mimon architecture really works in the three steps the very first step is that it reads the palm.xml file here that's the very first step second it downloads the dependencies uh defined in the power xml file into the local repository from the central or the remote repository here once that is done so it will uh you know create or generate the reports according to the life cycles which you have configured whether it's a clean install site deploy package or whatever the life cycle you want to trigger you will be triggering that particular life cycle and corresponding to that the build or a specific task will be performed so these are the three steps in which the overall build or any kind of uh execution of palm.xml file really happens here now what exactly is the maven build lifecycle so maven lifecycle isn't nothing but collection of steps here that needs to be uh followed for doing a proper uh build of a project here so there are primary three built-in cycles which is available there default which handles the project deployment clean which handles the project uh cleaning there and site which handles the creation of the project sites documentation so these are the three primary built-in build cycles life cycles which is available as such now so build life cycle has you know different kind of phases or the stages here because in the previous uh particular slide we were talking about what what are the different uh particular build life cycles which is available there but these are the different phases like what are the different step-by-step executions like for the deep down which is available there inside a specific maven build life cycle so here you can see that it's compiling then the test compile test execution is there then package integration test to verify install and the lastly deploy here so these are the different build phases which is available as such over here so what exactly is the command to use to do a particular maven site so mvn site is something which is used to create a maven site here now usually whatever the artifacts is prepared that will be prepared in the target directory so here also you will be able to see a site directory which is available there in the target directory which you can refer for the site documentations what is the different conventions used while naming a project in maven so usually it involves three components so the full name of a project in maven includes first of all the group id uh for example count at apache com.example so these are some of the particular way that where you can provide the group id artifact id can be exact project name like maven project or uh whatever the project you are creating so sample project example project so these kind of things will be there in the artifact id and lastly is the version like which version of your artifact you want to prepare like 1.0.0 hyphen snapshot 2.0.0 so like this information you are providing that what particular version you are trying to configure here now let's move on to the intermediate level where we will be having a little bit more complex questions related to the maven here now what exactly is a maven artifact now usually what happens that when we do a build process as an end of result of the build process we will get some artifacts for example when we build a.net project so there we will be able to have a exe or dll files as an artifacts similarly in case of maven when we do a build process there we get the different kind of artifacts like depending on the packaging mode like jar file var files or the er files here so these are something which is you know getting generated during the build process during the main process and you can store them into your local repository or you want to push them to the remote repository it's something that totally depends on you so maven is a tool which can help you to create all the artifacts whether it's a jar file whether it's a var files or whether it's a er file here and every artifact is having three attributes the first one is the group id the artifact id and a particular version and that's how you will be able to identify a full-fledged artifact as such in maven so maven is not about only the name of the jar file it's actually referring to the attributes like crop id the artifact id and the version of the artifact here now what are the different phases of the clean life cycle here so clean is something which is being used to clean the target directory so that a fresh build can be triggered there so there are three steps pretty clean clean and post clean here so if you wish that you want to override the particular life cycle configurations and you want to run some particular steps before the clean activity so you can do it into the pre-clean and if you want to do it like some steps after clean then post clean can be utilized now what are the different phases of the a site life cycle so pre site site post site and site deploy so these are the different phases which is available there in the site life cycle what is exactly we meant by the maven plugin now this is the huge difference between the ant and maven here because in and we were not having this that much support of the plugins and that's the reason why we had to deal with all the build configurations so we have to simply put the overall build process that how the build should be triggered but that is not something which is there in case of maven in maven we have a lot of flexibility because we can actually put up what exactly build configurations we want to put here we can put some features like important features over here in maven and uh these plugins we can utilize for example i want to perform a compilation now i don't really want to do any kind of configurations in this one so what i can do is that i can simply use the compilation plugin in maven and that can really help me because i don't have to unnecessarily write or rewrite the configuration that how the compilation should be done it's something which is pre-configured or pre-written in this plugins that i can simply import the plug-in and i can do the build process or the compilation process in a pretty standard mode so i don't really have to do any kind of workarounds with that and simply with a small automations i will be able to reach that how these maven plugins can be integrated into my palmer xml file and i can desire or i can have some particular procedures and some steps executed there so that's the biggest benefit which we really get with the help of maven plugins now why exactly the maven plugins are utilized so to create a jar files to create the war files to compile the code files to perform the unit testing to create the project documentation and to create the project reports so there are a variety of things in which we can actually use these maven plugins through the integrations within the palm.xml file there so it's all about the plugins you just import the plugin and that desired activity will be performed there now what are the different type of plugins which is there so you can have either build projects uh for performing the build activities you can have some build plugins for reporting plugins also there which can be only generated or utilized to generate the reports to process the reports and do any kind of formatting or any kind of processing on the reports here so that is where the reporting plugins are utilized now what is exactly the difference between the convention and the configuration in maven so convention is in particular process when the developers are not required to create the build processes so configuration is when you know the developers are supposed to create the build processes so the users do not have to rectify the configuration in detail and once the project is created it will automatically create a structure so they must specify every in case of configuration you have to provide each and every details so that's how the uh configurations really happens because um you have to put every detail into the power xml file and that's how the particular configurations really work as such so this is the huge difference between the conventions and the configurations here now so why exactly said that maven uses conventions over the configurations maven pretty much does not puts any efforts like on the particular developers that they have to put each and every configuration so there are some ready-made uh plugins which is available there and pretty much we are making use of that so that in such a case we don't have to worry about the executions and we will be able to pretty much work on that so conventions like maven uses the conventions incident of the configurations so the developers just you know they don't just have to create the human project the rest of the particular structure will be taken clear automatically so they are not uh you know expecting that the developers should be doing the configuration work and everything should be taken care in such a way that you just have to start the things and the rest of the things should be taken care by the maven itself so maven will be uh responsible because they do the plugins it will be responsible to set up the default architecture the default folder structures and all you have to do is that you have to just place the source code in the desired folder structure here so that's something which you need to do as on particular developers so what exactly is the maven order of inheritance here so the order of inheritance is the settings cli parameters parent pom and the project form which means that if you have some configuration and settings that will be the highest value then the cli parameters are there then the parent palm is there and then the project palm so this is the way that how the particular parameters or the configurations will be picked up by the may one so that's the order so what does the build life cycles and the phases imply in the basic concept of maven so build life cycles consist of a sequence of build phases and each build phase consists of a sequence of goals when a phase is run uh all the goals related to that phase and its plugins are also compiled so you will be able to have a lot of particular goals which is residing inside of phase there and similarly life cycle is nothing but a kind of a sequence of the different phase so life cycle comes in the top then it comes on the phases and then it comes on the goals here now what is the terminology called goal in case of maven the term a terminology goal refers to the specific task that makes it possible for the the project to be built and organized so it's something which we can run so it's an actual implementation which is going on there for example in the build process in the build phase i have a different goals like clean install package deploy these are the different typical goals which is available there which i can execute into the main one here so these are the different goals like uh which we can execute and which we can run during a maven build next question is what is exactly meant by the term dependencies and the repositories in maven here so dependencies refer to the java libraries which we usually put up into the bound.xml file there now what happens that sometimes our source code is requiring some java files like a secondary jar files for performing the build process so instead of downloading it and storing it into the class path for during the build process we just have to specify the dependency of that artifact what dependency we need to put and once that dependency is put up there we will be able to have that jar file downloaded and cached into the local repository during the maven build project now if the dependencies are not present in your local repository then maven will try to download it from the central repository and again if it is not a you know it's something which is available which is downloaded from the central repository then it will be cached locally into the local repository so that's the cycle which is being implemented and utilized during this process now what exactly is in snapshot in maven so snapshot refers to the version already available in the movement report repository it signifies the latest development copy that's what we do with the case of snapshot here so meven checks for a new version of snapshot in the remote repository for every new build so during the build process like you know a new snapshot version is being downloaded and the snapshot is updated by the data service team which uh with updated source code every time to the repository for each maven build so snap shot is something which we will be using like very frequently we will be updating to that and frequently we will be updating the version to that and we will try to explore and we will try to do the modifications now what are the different type of projects available in maven so there are thousands of java projects which you know uh can be utilized or we can be uh implemented by my one here so this helps the as the user that they as they no longer have to remember every configurations to set a particular project for example spring boot spring mvc spring boot etc these are the different projects which is already available in maven so most of the we have already discussed that for the job-based projects maven is something which is you know considered as by default so a lot of organizations are actually using it for you know storing or utilizing it for the uh particular maven project now what exactly is the maven uh archetype over here so maven octave refers to a maven plugin that is uh entitled to create a for project structure as per its template these archetypes are just project templates that are generated by maven when any new project is created there so this is something which we are using so that we will be able to create a fresh new projects right so let's go on to the advanced level of this maven questions now what exactly is the command to create a new project based on an archive type so mvn archetype generate is used to create a new java uh project based on the archetype now this will take up some parameters from as an end user from you and depending on that parameters it will create the palm.xml file it will create the source directories uh inside that main java test all these different couple of directories directory structures will be automatically created now why we require this command so that if you are going to create a project from scratch from the from the day one this command will help you to have all the folder structures created and then further on you can put up your source code and those files as such in this folder structure so that's how is the mechanism that we will be able to see that how the setup can be performed really over here now what does maven clean implies now movement clean is a plug-in that suggests that it's going to clean the files and directories there so whenever we do a build process usually in the target directory we have some class files some jar files or whatever the generated source code which is available that will be present in the target directory so the maven clean is something which is available which is going to clean all these directories and why we are doing this directly structure cleanup so that we will be able to do a fresh uh build process and there should not be any kind of issues as such over here so that's the main reason why we are looking forward for this uh particular mechanism or for this uh particular changes as such here now so what exactly isn't build profile all about so build profiles refers to the set of configurations uh where we can have like typically two different kind of build processes there so if you feel that the same form.xml file you can use you want to run for different different uh particular configurations so that you will be able to do pretty much with the help of this component so build profile is used to do a customization processes so that you will be able to have the process and you will be able to perform the configurations and the setups all together there so that's a very important aspect to be considered that which we need to uh discuss when we talk about the build profile so build profile whenever you feel that you want to do some customizations and you want to proceed with the setup so that's where it's utilized next thing is that what are different type of build profiles which is available there so the build profiles can be done on for a particular project like per project you can do you can uh even do the build profiles in the settings.xml file also and if you feel that you want to do it into the globalsettings.xml file so that also you can do as such over here so there are different ways in which you can do the customization and once the customization is done you will be able to have the different ways of doing the setups and the configurations over there so what exactly is meant by the uh particular system dependencies here so let's talk about that also so system dependencies refers to the uh particular mechanisms where we feel that how the dependencies should be you know present there so that is something which is having a scope of system there so these dependencies are commonly used to help me one know the dependencies that is being provided by the jdk system dependencies are mostly used to resolve the dependencies on the artifacts that are provided by the jdk so these dependencies are somewhat which is being utilized and used over here so that we will be able to implement and go ahead through the system dependencies what is the reason for using an optional dependency here so optional dependencies are used to decrease the transitive burden of some libraries so what happens that when you download an artifact when you put up a dependency so it could be a possibility that some dependencies as in particular optional can also be downloaded now these are not always required but yes sometimes what happens that these are downloaded so that you don't have to put each and every uh artifact or dependency into the powder xml file for example you're trying to download some apache tool and with that some like three four jar files or three four another dependencies are also getting downloaded now if you are using that dependencies that totally create because you don't have to put that uh list or that entry in the dependency list in the powder xml file and that can really save your time but if you feel that you don't want to have them and you these are the optional ones and you really want to get rid of that so that also you can exclude while downloading any kind of dependencies so these are the optional ones which depending on your requirement you can utilize you can process and if you feel that you don't want to get it you won't want to process it you can certainly ignore it and you can get rid of that also now what is a dependency scope and how many type of dependencies scope are there so there are different type of dependency scores which is there which is used on each and every stage of the build here so compile provided runtime test system import these are the different kind of dependency scopes which we have using which we can define that when exactly we want to go ahead for a specific build process so depending on your requirement you can explore all these build scopes and you can get benefits out of that what is exactly an intransitive dependency in maven so maven avoids the need to find out and specify libraries that our own dependencies require by including the transitive dependencies automatically so transitive dependency says that if he depends if x depends on y and y depends on z then x depends on y and both there so which means that you are not dependent on one artifact you also need the z artifact there with the y artifact so that is what you need to do so that you will get both the dependencies there because this is normal that if you are trying to download some particular artifacts or download some dependency and that dependency is also dependent on some other artifact or some other jar file then you have to include both of them so this is something which you will be able to get so that you uh can easily download all these dependent jar files also and the maven build can be successful how can a maven build profile can be activated so even build profile can be activated through a different ways so explicitly using the command command line you can talk about that which profile you want to execute through maven settings you can do uh based on environment parameters os settings and present and missing files so these are the different ways in which you can actually activate that which particular profile you want to have so profiles configurations are can also be saved in various situations and various files and from there you will be able to refer that which file you want to refer as such now what is meant by the dependency exclusion the exclusion is used to exclude any transitive dependency because you never know that if you are trying to put up a dependency uh entry in the power xml file that artifact is also further dependent on another artifact so in order to feel in order to see that you want to exclude that dependent artifact which is being automatically downloaded that also we can exclude with the help of exclusion so you can uh avoid the transitive dependency with the help of dependency exclusions here so what exactly is in mojo so mojo is nothing but maven plain old java object here so it's an executable goal in maven and a plug-in refer to the distribution of such mozos so moses enable the maven to extend its functionality that already is not founded in so it's kind of an extension which is there and using this we can get some additional benefits and some executions over there so what is the command to create a new project based on a hard drive so again archetype is something which we normally use to create uh the new projects now you can give the parameters in the command itself or you want it to in in kind of an interactive mode where it will take the parameters from the end user and according to that the project will be created onto hard drive or onto server wherever you wish you want to create you can create a new project so explain about the maven settings.xml file so maven settings.xml file contains the elements that are used to define that how the movement execution should be there so there are different uh settings like local remote central all these different repositories are configured as such over here now in this case what happens that usually the configurations are done in such a way that it can you know go for the executions it can go for the build process and the complete executions can be uh involved and can be achieved as such here so all these executions are something which we can really perform and uh here we can put some credentials how to connect to the remote repository how to connect to remote repository all that stuff is something which we talked about over here what exactly is that meant by term superb form here so superform refers to the default bomb of maven so the moms of maven can't derive from so it's nothing but a reference to a parent bomb which is available there that is a super pump so if you define some dependencies in that super pump automatically the uh child bomb will also be able to inherit all those dependencies so we can put some uh executions like we can put some configuration in the super pump so that if multiple uh projects are going to refer that they should be able to refer that easily so that's the reason why we primarily use the super pump so that we can have the execution some processes put up over there and all the other projects should be effort to refer or inherit from there so where exactly the dependencies are stored so dependencies are stored like in different locations like you have the local repository remote repositories there local repositories on the local developers machine and remote repository something which is available on a server in form of artifactory and so with this we have come to the end of this video i hope you guys find it informative and helpful thanks for watching and stay tuned for more from simply learn [Music] hi there if you like this video subscribe to the simply learn youtube channel and click here to watch similar videos turn it up and get certified click here
Info
Channel: Simplilearn
Views: 62,060
Rating: 4.3226666 out of 5
Keywords: maven tutorial, maven, maven tutorial for beginners, maven full course, apachemaven, maven course, learn maven from scratch, maven crash course, maven tutorial for devops, maven training, maven training free, learn maven step by step, learn maven for beginners, maven learn automation online, learn maven, what is maven, maven explained, maven lifecycle explained, maven tool tutorial, maven interview questions, maven build automation tool, simplilearn maven, simplilearn
Id: p0LPfK_oNCM
Channel Id: undefined
Length: 83min 44sec (5024 seconds)
Published: Mon Aug 17 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.