Maven Tutorial - Crash Course

Ever looked for a comprehensive intro to Maven that is fun and entertaining at the same time? Then have a look at this brand-new episode of "Marco Codes": Maven Tutorial [Crash Course].
In this video, you'll learn how to use Maven like a professional: installations, using the mvn wrapper, using Maven together with IDEs, and of course the Maven basics. From pom.xml concepts to running commands (clean install) to understanding Maven repositories and multi-module projects, by the end of it, there won't be many questions left when it comes to Maven.
► References
jb.gg/4r7d6s
► Table Of Contents
00:00 Intro
00:30 Cloning The Sample Project
01:09 Installing Maven - Package Manager
01:34 Installing Maven - Manual
02:57 Maven Wrapper
04:31 mvn validate
05:21 IntelliJ - Importing Maven Projects
06:12 Pom.xml - Basics
07:07 Pom.xml - Properties
07:38 Pom.xml - Build Section
08:06 Pom.xml - Dependencies
09:40 Pom.xml - Dependency Scopes
11:41 search.maven.org - Dependency Search
12:27 IntelliJ - Maven Reload Trick
13:11 IntelliJ - Dependency Search
15:04 Maven Directory Structure
15:25 mvn clean
15:37 mvn compile
16:00 mvn test
17:45 mvn package
18:36 mvn install
19:18 Local Maven Repository
20:25 Central Maven Repository
22:28 Multi Module Projects
► Further Reading:
mvn clean install - www.marcobehler.com/guides/mv...
Maven: The Complete Reference - books.sonatype.com/mvnref-boo...
► FOLLOW ME
www.marcobehler.com
/ marcobehler

Пікірлер: 145

  • @kashmeu
    @kashmeu Жыл бұрын

    Such a concise and to-the-point video. Probably the best video I have watched on this topic.

  • @Jod4light
    @Jod4light2 жыл бұрын

    Really good to explain and describe new things to people! You're doing an excellent job here!

  • @smikkelbeer7890
    @smikkelbeer7890 Жыл бұрын

    Thank you, this was a lifesaver. For whatever reason, my university decided to completely skip explaining Maven before explaining Spring.

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Glad it helped!

  • @cyberrb25

    @cyberrb25

    Ай бұрын

    Honestly? Similar case. They told us to use Maven, yet no one told us how to use Maven. And because they forced us to do a lot, we didn't even have the time of day to even investigate how Maven works.

  • @keldur16
    @keldur164 ай бұрын

    I’m still new to development and have been branching out on my own in addition to my classes and I kept running across maven but didn’t understand what it did. It became unavoidable when I committed to spending the next month trying to learn spring boot. Your explanation has made it so clear and simple to me and helped my growing understanding as a programmer. Thanks

  • @inkastraredbrother8516
    @inkastraredbrother8516 Жыл бұрын

    The smoothest and the clearest explanation I've ever seen. Thanks, man)

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Thank you :)

  • @xpluiz
    @xpluiz2 жыл бұрын

    That's a understandable, pratical and simple example from how to use maven. Congrats keep the excelent work!!

  • @parkerhix1057
    @parkerhix10576 ай бұрын

    very clear tutorial, thanks so much. i like how you not only tell us what the most important parts of maven are, but also tell us WHY they're important. for instance, you mentioned that the pom.xml is important, gave an explanation of what it does, and then told us that since all maven projects have pom.xml, it helps with standardizing projects. thus, we can expect most maven projects to look more or less the same in structure. very useful tutorial.

  • @nitiniit07
    @nitiniit07 Жыл бұрын

    Great tutorial, sort of one stop shop to revise maven concepts quickly before the interviews and also brush up after every few months when need to get back to basics to nail down more technical stuff around maven.

  • @abhishek_m89
    @abhishek_m89 Жыл бұрын

    Thank you for the excellent content Marco. Simple & Clear.

  • @shubhammguptaa
    @shubhammguptaa Жыл бұрын

    You are amazing! Thanks for this short and crisp video.

  • @halilkose9602
    @halilkose96022 жыл бұрын

    Thank you Marco :) I look forward to your next videos... with excitement and interest.

  • @egcoolmauricio
    @egcoolmauricio Жыл бұрын

    I'm so new in JAVA world, I come from C# world, and your videos helped me to understand in a simple way everything. Thanks and please continue making videos. Regards from Argentina

  • @fieryscorpion

    @fieryscorpion

    3 ай бұрын

    I'm in the same boat and am very surprised how complicated Java world is. Compared to Java world, .NET world is pure heaven.

  • @user-nf1dg2rn4v
    @user-nf1dg2rn4v5 ай бұрын

    The clearest explanation I've ever seen. Thanks

  • @arjitmishra100
    @arjitmishra1005 ай бұрын

    Great tutorial. Just quick points for everyone. In multimodule project we can see and the difference from normal and tags is - dependency/plugin inside management tag are managed by parent but are not inherited by children implicitly. Child need to explicitly define the dependency/plugin in their pom.xml but can omit things like version/exclusions/configuration etc. which will be managed by parent. This helps in proving the dependency to the module which needs it.

  • @prathap2712
    @prathap27128 ай бұрын

    Pro content given for free. Thanks Marco!!

  • @neblintysla
    @neblintysla Жыл бұрын

    WOW, thank you for such concise and clear explanation, great job! 👌🏼👌🏼

  • @sudeshryan8707
    @sudeshryan870711 ай бұрын

    Marco thanks a lot for this comprehensive tutorial. Im hoping to learn SpringBoot and this has been a great tutorial about java package management. Keep up the good work.

  • @owaistnt
    @owaistnt Жыл бұрын

    Thank you. I understood this time finally. I would love to explore more on Maven. Recently I am supposed to push my Kotlin Multi Modules as shared libraries this video have given me those basics

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Glad it was helpful!

  • @user-ib8rv1vr4r
    @user-ib8rv1vr4r2 жыл бұрын

    Really good. Now I am learning Spring MVC on Selenium Express channel to understand Spring MVC and start from Spring Boot... by your course appeared several days ago. Thanks!

  • @SuperMichielv
    @SuperMichielv Жыл бұрын

    Very nice explained! Seeing Forward for more of this good stuff.

  • @fnuanshuman5736
    @fnuanshuman57363 ай бұрын

    Beautifully explained. You've earned a subscriber sir! Kudos!

  • @harigovind511
    @harigovind511 Жыл бұрын

    I am a full stack guy, but haven't developed anything on Java for years now. This video was a perfect way for me to get back into some open source contributions. Really appreciate this, thanks for being a part of this community.

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Glad you liked it!

  • @lemoi6462

    @lemoi6462

    10 ай бұрын

    @@MarcoCodes Im glad that your glad that he liked it

  • @yadivergulyanitskyy7929

    @yadivergulyanitskyy7929

    9 ай бұрын

    @@lemoi6462 oh guys, and I'm so glad that you all are glad he liked it!

  • @MarcoCodes

    @MarcoCodes

    4 ай бұрын

    I'm even glad-er than that!

  • @Roadrunner_KZSK

    @Roadrunner_KZSK

    3 ай бұрын

    same

  • @lukezeches2642
    @lukezeches26426 ай бұрын

    This was super helpful, I've always put off learning about Maven and now it seems way less daunting

  • @robertheitzler9547
    @robertheitzler95477 ай бұрын

    Marco - Thank you for this. I was struggling with one simple step being new to IntelliJ and coming back to Maven after years of other work. This is one of the best walk throughs I've seen. +me = new Subscriber.

  • @MarcoCodes

    @MarcoCodes

    7 ай бұрын

    Glad it helped. What was the step you struggled with?

  • @moritzbreitbach6976
    @moritzbreitbach6976 Жыл бұрын

    Excellent and concise tutorial, thanks!

  • @thedevbek
    @thedevbek Жыл бұрын

    @MarcoCodes you are a funking ROCKSTAR! I finally not only understand what maven does but know how to get the thing working. Just ran my first test thanks so much!!!!

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Thank you! :)

  • @andriihaidychuk2885
    @andriihaidychuk2885 Жыл бұрын

    Thank you for the short and very useful explanation. It would be good to have continuation of Maven topic with more advanced stuff

  • @aliaksandrhubanau4933
    @aliaksandrhubanau4933 Жыл бұрын

    Hi, Marco! Thanks a lot for all your videos. Really cool and useful stuff for newbies and sometimes for experienced fellows, who want to refresh knowledges. You're very charismatic and nice speaker. Please continue share some free stuff it's very important for community. Thanks a lot! Stay true!

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Thank you!

  • @hotshotgolfer3079
    @hotshotgolfer30799 ай бұрын

    awesome tutorial!! learning springboot with angular. I had to rebuild dependencies after adding. Learned so much more here. TY. HSG

  • @Cyan3boN
    @Cyan3boN Жыл бұрын

    Brilliant tutorial, Thanks. Pls make more videos like this.

  • @scholarshiphelp5999
    @scholarshiphelp59996 ай бұрын

    Wowww! That went smooooth. Really helpful video on maven.

  • @RobMitchell001
    @RobMitchell001 Жыл бұрын

    Thanks for making this video! Very nice!!

  • @snehal_5474
    @snehal_54746 ай бұрын

    Concepts are crystal clear😊

  • @heeseung5
    @heeseung5 Жыл бұрын

    I am a big fan. You are awesome. You are helping so many people

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Thank you, Joseph!

  • @hillcountrydev
    @hillcountrydev2 жыл бұрын

    loving your channel! subscribed and already told a few dev buddies to subscribe. great content

  • @sankalparora8146
    @sankalparora81467 ай бұрын

    Amazing tutorial!! Thanks!

  • @StarContract
    @StarContract4 ай бұрын

    Incredible tutorial, fast and clear. Maven is a Java Swiss knife if you master it.

  • @mauro--1521
    @mauro--1521 Жыл бұрын

    Very valuable content. Thank you!

  • @igorvologodskiy2964
    @igorvologodskiy29642 жыл бұрын

    Marco great thanks indeed! It is amazing and really useful!

  • @michelchaghoury9629
    @michelchaghoury96292 жыл бұрын

    Please keep going, we need more and more content about testing and best practicies

  • @MarcoCodes

    @MarcoCodes

    2 жыл бұрын

    Just finished recording the next video - so....more is coming :)

  • @michelchaghoury9629

    @michelchaghoury9629

    2 жыл бұрын

    @@MarcoCodes gr8 very excited

  • @misaelramirez7550
    @misaelramirez7550 Жыл бұрын

    Excellent class!

  • @gazeuze
    @gazeuze5 ай бұрын

    thanks for the video! you explained it really good

  • @iliachakarov7285
    @iliachakarov72856 ай бұрын

    MARCO THE G COMING AT IT AGAIN !!!! THX !!!!!!!

  • @badripaudel77
    @badripaudel772 жыл бұрын

    Crystal 🔮 clear ❤️❤️❤️❤️ What a content.

  • @elcio-dalosto
    @elcio-dalosto5 ай бұрын

    Man, thank you for this!

  • @paurushgargtube
    @paurushgargtube Жыл бұрын

    Thanks a lot. Awesome explanation.

  • @austinclark3439
    @austinclark343910 ай бұрын

    this was excellent. thank you!

  • @leoniaklebanov2502
    @leoniaklebanov25029 ай бұрын

    Awesome tutorial!!!❤

  • @alejandro7362
    @alejandro7362 Жыл бұрын

    I'm a data scientist used to work with python and just started to built ML projects with Java. Awesome video, I understand enough to just start building a proper project

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Glad it helped!

  • @adildk4486
    @adildk4486 Жыл бұрын

    Thank you, thank you very very very much, You do best, Keep Going MAN

  • @prakhartarun8554
    @prakhartarun8554 Жыл бұрын

    Very well explained. Thank you Macro :)

  • @Rawbful
    @Rawbful3 ай бұрын

    awesome intro thanks!

  • @greengrer
    @greengrer Жыл бұрын

    Thank you for the wonderful tutorial

  • @hoyinli7462
    @hoyinli74629 ай бұрын

    love your work

  • @ollepetersson5031
    @ollepetersson50319 ай бұрын

    Thanks Marco!

  • @muhammadsubhan8333
    @muhammadsubhan83335 ай бұрын

    Good video about Maven build tool. 👍

  • @szpinakowazelka
    @szpinakowazelka11 ай бұрын

    Great explanation

  • @sshawish
    @sshawish2 жыл бұрын

    Thank you You are the best Keep going

  • @rukshanj.senanayaka1467
    @rukshanj.senanayaka146710 ай бұрын

    I'm currently doing a task related with maven. This tutorial seems so promisiing. I'll update here how my task goes.

  • @BharathKalyanS-hc1rh
    @BharathKalyanS-hc1rh Жыл бұрын

    Thanks for the Video!

  • @thomi100
    @thomi100Ай бұрын

    Very nice, thanks 👍🏻

  • @maxleonov7801
    @maxleonov78012 жыл бұрын

    Thank you Marco! =)

  • @toritsejuFO
    @toritsejuFOАй бұрын

    Dead simple explanations. Dunno how you do it. Thank you Marco. Love your website as well, such deep and comprehensive articles. I have one (1) ask 🙏🏿 Kindly consider reducing your paid courses for some of us here in Nigeria 😣🤲🏿 Thank you

  • @screenvinylimage733
    @screenvinylimage733 Жыл бұрын

    amazing, thank you so much

  • @himanidave8054
    @himanidave80543 ай бұрын

    Thank you! 🙌

  • @EthanZitting-pg7te
    @EthanZitting-pg7te2 ай бұрын

    Thank you very much!

  • @user-gx7vo7yy4o
    @user-gx7vo7yy4o11 ай бұрын

    great content, thnx.

  • @aquere
    @aquere Жыл бұрын

    That was cool!

  • @ilyesilyes580
    @ilyesilyes580 Жыл бұрын

    the best tutorial , tnx

  • @techbay5850
    @techbay5850 Жыл бұрын

    Great nice work

  • @jan6347
    @jan634710 ай бұрын

    If anyone is wondering why "mvn clean" does not remove the "target" directory in VS Code (which was my case), it has to do with enabled "auto build". Just go into settings, search for Java Autobuild and disable it.

  • @robertwaldmann4544
    @robertwaldmann45444 ай бұрын

    love it

  • @user-rv7wf5rt6m
    @user-rv7wf5rt6m3 ай бұрын

    Cool Bro !!!

  • @TTM111
    @TTM1112 жыл бұрын

    Thank you

  • @user-cv1pi1xq4w
    @user-cv1pi1xq4w Жыл бұрын

    Thanx man!))

  • @clutchmadness
    @clutchmadness Жыл бұрын

    thank you

  • @maximelmanov6719
    @maximelmanov67192 жыл бұрын

    Thank you very much! Make same overview for Gradle, please!

  • @avgSE81
    @avgSE819 ай бұрын

    Marco can you please make a video explaining Maven Vs Gradle in a nice and easy manner?

  • @ayuobmousa6589
    @ayuobmousa6589 Жыл бұрын

    the second time and i think there will be third One 👍

  • @HaiNaZheng
    @HaiNaZheng8 ай бұрын

    Nice tutorial. Could you please give the multi-module example project repository?

  • @MarcoCodes

    @MarcoCodes

    8 ай бұрын

    I should be a different branch in the linked source repository.

  • @sajjadvalaei2535
    @sajjadvalaei2535 Жыл бұрын

    thanks.

  • @user-xb1ts1rs4g
    @user-xb1ts1rs4g Жыл бұрын

    Tnx

  • @aldairacosta4393
    @aldairacosta43939 ай бұрын

    This man is crazy just for use the light theme in his IDE

  • @MarcoCodes

    @MarcoCodes

    9 ай бұрын

    No matter which theme, people complain :)

  • @deicide2324
    @deicide2324 Жыл бұрын

    Hi Marco, do you have any idea that why the command mvn spring-boot:run will only execute on the jar file in repo instead of the target folder in the module?

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Hey @Deicide, it should actually do neither (jar in repo, target folder), instead it should run your app "in-place". That's because afaik it doesn't ever run the package/install step, i.e. there is no jar being generated.

  • @deicide2324

    @deicide2324

    Жыл бұрын

    @@MarcoCodes Thanks for you detailed explanation!

  • @alandosman5002
    @alandosman5002 Жыл бұрын

    nice video ma dude, now what do you use and prefer? Maven or gradle? and why?

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Been going back and forth between the two over the years. Slightly prefer Maven, because it's harder to shoot yourself in the foot with it, but happy to use either one.

  • @alandosman5002

    @alandosman5002

    Жыл бұрын

    @@MarcoCodes thanksss

  • @hanswurst7206
    @hanswurst7206 Жыл бұрын

    When I use the Maven tool in IntelliJ and call install:install, the error occurs: "The packaging for this project did not assign a file to the build artifact". What ist the problem?

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Only call "install", not "install:install" :)

  • @user-og7de8ih4f
    @user-og7de8ih4f Жыл бұрын

    Marco please make video on maven plugins..thanks for valuable content though

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    any specific questions about Maven plugins?

  • @tyler13923
    @tyler13923 Жыл бұрын

    really enjoyed this and jdbc vid.... can you cover tomcat in depth for us ???

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Not on the list at the moment, but I'll put it in the backlog.

  • @OmriYaHoo
    @OmriYaHoo Жыл бұрын

    Hi Marco, Any reason you skipped the "verify" step?

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Hey Omri, no specific reason, other than I somewhat have seen it more rarely used in projects in the past.

  • @OmriYaHoo

    @OmriYaHoo

    Жыл бұрын

    @@MarcoCodes Well, as a tutorial I would prefer you show the correct way of doing things in maven :) The fact that people rarely use it means they don't know about it or are working incorrectly regarding the mix of unit tests compared to integration tests. I do see people 90% percent of the time just run "mvn clean install" when "clean" only deletes the target which is not required 90% of the time and the "install" is also not needed since people mostly don't publish their own project as a repo locally unless they are part of the platform/framework internal team in the company.

  • @marinosag8808
    @marinosag88085 ай бұрын

    I cannot find the code of the tutorial in github

  • @MarcoCodes

    @MarcoCodes

    5 ай бұрын

    Check the references doc from the description.

  • @GalaxiaDeFavio
    @GalaxiaDeFavio2 жыл бұрын

    how I build a simple module app with img resources?

  • @MarcoCodes

    @MarcoCodes

    2 жыл бұрын

    I don't know if this is what you meant by the question, but: You just put all your images and other static resources under "src/main/resources", instead of "src/main/java". If not, let me know.

  • @GalaxiaDeFavio

    @GalaxiaDeFavio

    2 жыл бұрын

    @@MarcoCodes because when you do a manifest for the jar you put every image that is beign used so I thought I'll have to specify the images

  • @leniedor733
    @leniedor7332 жыл бұрын

    Massive ads you did, hope it’s nice as first ! Good video

  • @berndeckenfels
    @berndeckenfels8 ай бұрын

    Misses the most important goal verify which is between package and before install. That one is the normal one to use if you don’t need the install

  • @MarcoCodes

    @MarcoCodes

    8 ай бұрын

    Depends on what type of project you are building, e.g. if you have any integration tests bound to verify. Often times, that's not the case, so "most important" depends.

  • @berndeckenfels

    @berndeckenfels

    8 ай бұрын

    @@MarcoCodesif you don’t have tests it does not hurt to run verify instead of package, but it does hurt if you run install unnecessary.

  • @okey1317
    @okey131710 ай бұрын

    24:14 There is version specified there

  • @MarcoCodes

    @MarcoCodes

    10 ай бұрын

    Hm?

  • @okey1317

    @okey1317

    10 ай бұрын

    @@MarcoCodes I see there. You told it isn't

  • @MarcoCodes

    @MarcoCodes

    10 ай бұрын

    That's the parent's version, not the version of the module.

  • @devrajatverma
    @devrajatverma3 ай бұрын

    0:00 - 0:02 🤣

  • @guai9632
    @guai96324 ай бұрын

    maven forces you to program in xml, unless you project produces the simplest jar. what's nice about that? and its architecture is a dark closet full of black boxes, and there's nothing easy about that.

  • @MarcoCodes

    @MarcoCodes

    4 ай бұрын

    What? :)

  • @guai9632

    @guai9632

    4 ай бұрын

    @@MarcoCodes you wrote bs on the thumbnail

  • @MarcoCodes

    @MarcoCodes

    4 ай бұрын

    whaaaaaaaaat

  • @GildwareTechnologies
    @GildwareTechnologies Жыл бұрын

    Maven is an essential build automation tool for Java projects, and understanding its concepts and functionality is crucial for every Java developer. This Maven tutorial provides a crash course that covers the basics and helps you get up and running quickly. If you're looking to further enhance your Maven skills and delve into more advanced topics, I highly recommend exploring the job-oriented software development courses offered by Gildware Technologies. Based in Srinagar, Gildware Technologies is renowned for providing comprehensive training in software engineering, including courses that cover Maven and other important tools and frameworks in Java development. By enrolling in their courses, you'll gain hands-on experience and practical knowledge to become proficient in Maven and strengthen your Java development skills. To learn more about the training programs offered by Gildware Technologies, visit their website at gildware.com/best-software-engineering-training-institute-in-kashmir. Don't miss out on the opportunity to learn from industry experts and take your Maven skills to the next level. Start your journey towards becoming a proficient Java developer with Gildware Technologies today!

  • @MarcoCodes

    @MarcoCodes

    11 ай бұрын

    Gildware! Gildware!

  • @meshmuhammad6927
    @meshmuhammad69274 ай бұрын

    Sauce Code .-.

  • @oukkalyacine3051
    @oukkalyacine3051 Жыл бұрын

    try to use darkmode please

  • @MarcoCodes

    @MarcoCodes

    Жыл бұрын

    Not going to happen, as people complained about dark mode when I used it :D

  • @NinuRenee
    @NinuRenee2 ай бұрын

    I hate learning about new build systems just to install a single package