Maven Tutorial - Crash Course

Поделиться
HTML-код
  • Опубликовано: 26 июн 2024
  • 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

Комментарии • 146

  • @smikkelbeer7890
    @smikkelbeer7890 Год назад +16

    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 Месяц назад +1

      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.

  • @kashmeu
    @kashmeu Год назад +4

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

  • @keldur16
    @keldur16 5 месяцев назад +4

    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 Год назад +8

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

  • @arjitmishra100
    @arjitmishra100 6 месяцев назад +5

    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.

  • @xpluiz
    @xpluiz 2 года назад +1

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

  • @Jod4light
    @Jod4light 2 года назад +11

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

  • @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.

  • @shubhammguptaa
    @shubhammguptaa Год назад +1

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

  • @abhishek_m89
    @abhishek_m89 Год назад +2

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

  • @halilkose9602
    @halilkose9602 2 года назад

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

  • @user-nf1dg2rn4v
    @user-nf1dg2rn4v 5 месяцев назад

    The clearest explanation I've ever seen. Thanks

  • @parkerhix1057
    @parkerhix1057 7 месяцев назад

    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.

  • @prathap2712
    @prathap2712 9 месяцев назад +1

    Pro content given for free. Thanks Marco!!

  • @harigovind511
    @harigovind511 Год назад +35

    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  Год назад +2

      Glad you liked it!

    • @lemoi6462
      @lemoi6462 10 месяцев назад

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

    • @yadivergulyanitskyy7929
      @yadivergulyanitskyy7929 10 месяцев назад

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

    • @MarcoCodes
      @MarcoCodes  5 месяцев назад

      I'm even glad-er than that!

    • @Roadrunner_KZSK
      @Roadrunner_KZSK 4 месяца назад

      same

  • @neblintysla
    @neblintysla Год назад

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

  • @sudeshryan8707
    @sudeshryan8707 Год назад

    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 Год назад +3

    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

  • @SuperMichielv
    @SuperMichielv Год назад

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

  • @moritzbreitbach6976
    @moritzbreitbach6976 Год назад +1

    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!!!!

  • @user-ib8rv1vr4r
    @user-ib8rv1vr4r 2 года назад

    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!

  • @lukezeches2642
    @lukezeches2642 7 месяцев назад +2

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

  • @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 4 месяца назад

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

  • @robertheitzler9547
    @robertheitzler9547 7 месяцев назад

    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?

  • @fnuanshuman5736
    @fnuanshuman5736 3 месяца назад

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

  • @hotshotgolfer3079
    @hotshotgolfer3079 10 месяцев назад

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

  • @snehal_5474
    @snehal_5474 6 месяцев назад

    Concepts are crystal clear😊

  • @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

  • @Cyan3boN
    @Cyan3boN Год назад

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

  • @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!

  • @scholarshiphelp5999
    @scholarshiphelp5999 6 месяцев назад

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

  • @RobMitchell001
    @RobMitchell001 Год назад

    Thanks for making this video! Very nice!!

  • @iliachakarov7285
    @iliachakarov7285 7 месяцев назад

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

  • @heeseung5
    @heeseung5 2 года назад +1

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

  • @badripaudel77
    @badripaudel77 2 года назад

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

  • @mauro--1521
    @mauro--1521 Год назад

    Very valuable content. Thank you!

  • @gazeuze
    @gazeuze 6 месяцев назад

    thanks for the video! you explained it really good

  • @igorvologodskiy2964
    @igorvologodskiy2964 2 года назад

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

  • @hillcountrydev
    @hillcountrydev 2 года назад +1

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

  • @michelchaghoury9629
    @michelchaghoury9629 2 года назад +6

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

    • @MarcoCodes
      @MarcoCodes  2 года назад +4

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

    • @michelchaghoury9629
      @michelchaghoury9629 2 года назад

      @@MarcoCodes gr8 very excited

  • @misaelramirez7550
    @misaelramirez7550 Год назад

    Excellent class!

  • @paurushgargtube
    @paurushgargtube Год назад

    Thanks a lot. Awesome explanation.

  • @austinclark3439
    @austinclark3439 11 месяцев назад

    this was excellent. thank you!

  • @StarContract
    @StarContract 4 месяца назад

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

  • @elcio-dalosto
    @elcio-dalosto 5 месяцев назад

    Man, thank you for this!

  • @sankalparora8146
    @sankalparora8146 8 месяцев назад

    Amazing tutorial!! Thanks!

  • @leoniaklebanov2502
    @leoniaklebanov2502 10 месяцев назад

    Awesome tutorial!!!❤

  • @Rawbful
    @Rawbful 4 месяца назад

    awesome intro thanks!

  • @adildk4486
    @adildk4486 Год назад

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

  • @greengrer
    @greengrer Год назад

    Thank you for the wonderful tutorial

  • @hoyinli7462
    @hoyinli7462 10 месяцев назад

    love your work

  • @toritsejuFO
    @toritsejuFO 2 месяца назад

    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

  • @prakhartarun8554
    @prakhartarun8554 Год назад

    Very well explained. Thank you Macro :)

  • @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

  • @sshawish
    @sshawish 2 года назад

    Thank you
    You are the best
    Keep going

  • @muhammadsubhan8333
    @muhammadsubhan8333 6 месяцев назад

    Good video about Maven build tool. 👍

  • @szpinakowazelka
    @szpinakowazelka 11 месяцев назад

    Great explanation

  • @ollepetersson5031
    @ollepetersson5031 9 месяцев назад

    Thanks Marco!

  • @BharathKalyanS-hc1rh
    @BharathKalyanS-hc1rh Год назад

    Thanks for the Video!

  • @maxleonov7801
    @maxleonov7801 2 года назад

    Thank you Marco! =)

  • @himanidave8054
    @himanidave8054 4 месяца назад

    Thank you! 🙌

  • @thomi100
    @thomi100 2 месяца назад

    Very nice, thanks 👍🏻

  • @EthanZitting-pg7te
    @EthanZitting-pg7te 2 месяца назад

    Thank you very much!

  • @screenvinylimage733
    @screenvinylimage733 2 года назад

    amazing, thank you so much

  • @aquere
    @aquere Год назад

    That was cool!

  • @rukshanj.senanayaka1467
    @rukshanj.senanayaka1467 11 месяцев назад

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

  • @user-gx7vo7yy4o
    @user-gx7vo7yy4o 11 месяцев назад

    great content, thnx.

  • @techbay5850
    @techbay5850 Год назад

    Great nice work

  • @user-rv7wf5rt6m
    @user-rv7wf5rt6m 3 месяца назад

    Cool Bro !!!

  • @ilyesilyes580
    @ilyesilyes580 Год назад

    the best tutorial , tnx

  • @robertwaldmann4544
    @robertwaldmann4544 5 месяцев назад

    love it

  • @jan6347
    @jan6347 11 месяцев назад +1

    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.

  • @clutchmadness
    @clutchmadness Год назад

    thank you

  • @TTM111
    @TTM111 2 года назад

    Thank you

  • @user-cv1pi1xq4w
    @user-cv1pi1xq4w Год назад

    Thanx man!))

  • @aldairacosta4393
    @aldairacosta4393 9 месяцев назад

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

    • @MarcoCodes
      @MarcoCodes  9 месяцев назад

      No matter which theme, people complain :)

  • @maximelmanov6719
    @maximelmanov6719 2 года назад

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

  • @user-xb1ts1rs4g
    @user-xb1ts1rs4g Год назад

    Tnx

  • @ayuobmousa6589
    @ayuobmousa6589 Год назад

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

  • @sajjadvalaei2535
    @sajjadvalaei2535 Год назад

    thanks.

  • @deicide2324
    @deicide2324 2 года назад

    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  2 года назад +1

      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 2 года назад

      @@MarcoCodes Thanks for you detailed explanation!

  • @avgSE81
    @avgSE81 10 месяцев назад +1

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

  • @beastcombatanalysing635
    @beastcombatanalysing635 6 дней назад

    Please help mine isn't responding to the path when I key in mvn -v in the cmd prompt it doesn't do anything, I've been going in circle for 6 days now

  • @alandosman5002
    @alandosman5002 Год назад

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

    • @MarcoCodes
      @MarcoCodes  Год назад +1

      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

  • @HaiNaZheng
    @HaiNaZheng 8 месяцев назад

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

    • @MarcoCodes
      @MarcoCodes  8 месяцев назад +1

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

  • @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 2 года назад

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

    • @MarcoCodes
      @MarcoCodes  2 года назад

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

  • @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" :)

  • @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.

  • @leniedor733
    @leniedor733 2 года назад

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

  • @berndeckenfels
    @berndeckenfels 9 месяцев назад

    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.

  • @GalaxiaDeFavio
    @GalaxiaDeFavio 2 года назад

    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

  • @okey1317
    @okey1317 10 месяцев назад

    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.

  • @marinosag8808
    @marinosag8808 6 месяцев назад

    I cannot find the code of the tutorial in github

    • @MarcoCodes
      @MarcoCodes  6 месяцев назад

      Check the references doc from the description.

  • @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!

  • @devrajatverma
    @devrajatverma 3 месяца назад

    0:00 - 0:02 🤣

  • @oukkalyacine3051
    @oukkalyacine3051 Год назад

    try to use darkmode please

    • @MarcoCodes
      @MarcoCodes  Год назад +1

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

  • @guai9632
    @guai9632 5 месяцев назад +1

    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  5 месяцев назад

      What? :)

    • @guai9632
      @guai9632 5 месяцев назад

      @@MarcoCodes you wrote bs on the thumbnail

    • @MarcoCodes
      @MarcoCodes  5 месяцев назад

      whaaaaaaaaat

  • @NinuRenee
    @NinuRenee 3 месяца назад

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