How to run Maven Project from command line | mvn clean install | Build Maven using cmd prompt #maven

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi guys welcome back so let's start with our session for you so previous session we have run our test cases from the eclipse okay so let us see how you can run your test cases from the command prompt okay so first thing you need to go to your project location first okay so you cannot directly use like if you open the command prompt and from here if you use the same commands you cannot you know run your test cases so first step is go to your project location go to your maven project location okay and open command prompt okay so this is the first step okay so my project is where if you want to know the location go to the properties and this is the location where my project is available okay so you need to go to this location okay click on that and open it so this pom.xml file will be visible so from here you need to open the command prompt okay so just you can write here as well command until open the command prompt from this location okay so this pom.xml file will be used to run your test cases so in previous session press session we have added these different plugins like one is the compiler plugin the latest version and another one is surefire plugin okay and the commands that we used click maven test maven install on maven clean install okay so same commands you need to use for the running your test case from the command prompt okay so let us run uh let us keep these plugins as it is in the form.xml and it will use this okay and after that we will remove this plug-in so without plug-in let us see if we can uh run the test cases okay so let us use it so same command you need to use the main one test so this command will run your test cases okay so just write this maven test and enter okay so it will download some plugin first as we are running from the command prompt okay so you can see the latest version we added in the form.xml three point eight point one compiler plugin and mirror surplus plugin three point zero point zero m5 okay so to clean your project we need to use maven clean first okay let us clean our project as you can see these commands are same commands you can use okay you just have to remember it okay you need to remember it guys so once it is cleaned may one install okay so as you can see we are here at where it is okay it has cleaned so test the target folder is not available here as of now as you have cleaned our project so let us run this maven install okay all the test case run and this jar file is also created this one building jar using jar plugin as i already said for creating the jars you need to use this jar plugin okay and by default the goal of the jar plugin will be the jar right so go and watch this maven session too it's a quite good learning for you as as far as interviews are concerned that will help you in interviews as well okay and you can use the same in your current project in actual project as well okay so let us see where is our jar jar will be here in target folder okay this jar got created okay so let us use another command the next command is mvn clean install okay let us run this okay files got cleaned and the new files got created okay so this is the use of maven clean install first clean the project and then create the run the test case and create the jar file okay so let us uh remove this data like we want to see that uh is maven is able to run the my own project by using the by default maven plug-in a mobile compiler plug-in and mirror sure player again okay so let us remove this and don't forget to save it okay save it and now let us see like this time it has used the latest versions 3.8.1 and 3.0 so mean clean install so it will definitely use the by default plugin versions okay so as you can see in the test case data and 2.12.4 okay so this is the default plugin surefire plugin and compiler plugin okay so similarly we use whatever commands we use to run our main project from the com from the eclipse okay so same commands we use to run our project from the command prompt okay so you won't be able to run your main project outside of the click eclipse if you don't have uh downloaded and the maven software and you need to provide provide the environmental variables you know the path in the environmental variables that i already set up okay so [Music] same commands will be applicable here so one test okay so that's it for this video and next session we are going to see how you can skip the test cases in maven okay so we run all the test cases from eclipse and command but if there is a requirement that you don't want to run your test case you just need a jar file of your project so how you can you do that so that we will see in the next session okay so thanks for watching uh if you are new to this channel subscribe to the channel and press the bell icon so that you will get the notification for the newly added videos okay so that's for it see you in the next video soon thank you you
Info
Channel: AJ AUTOMATION
Views: 54,816
Rating: undefined out of 5
Keywords: maven tutorial, mvn package, testng with maven, maven tutorial for beginners, build automation tools, create JAR, create jar file in eclipse, maven install, mvn clean install command, how to run maven project from command, how to run selenium maven project from command prompt, how to run maven project from command prompt, create maven project in eclipse, Create and run maven project from command line, build maven project using, build maven project using command line
Id: wku2x1iVQe0
Channel Id: undefined
Length: 8min 29sec (509 seconds)
Published: Sat Aug 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.