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
Such a concise and to-the-point video. Probably the best video I have watched on this topic.
Really good to explain and describe new things to people! You're doing an excellent job here!
Thank you, this was a lifesaver. For whatever reason, my university decided to completely skip explaining Maven before explaining Spring.
@MarcoCodes
Жыл бұрын
Glad it helped!
@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.
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
The smoothest and the clearest explanation I've ever seen. Thanks, man)
@MarcoCodes
Жыл бұрын
Thank you :)
That's a understandable, pratical and simple example from how to use maven. Congrats keep the excelent work!!
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.
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.
Thank you for the excellent content Marco. Simple & Clear.
You are amazing! Thanks for this short and crisp video.
Thank you Marco :) I look forward to your next videos... with excitement and interest.
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
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.
The clearest explanation I've ever seen. Thanks
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.
Pro content given for free. Thanks Marco!!
WOW, thank you for such concise and clear explanation, great job! 👌🏼👌🏼
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.
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
Жыл бұрын
Glad it was helpful!
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!
Very nice explained! Seeing Forward for more of this good stuff.
Beautifully explained. You've earned a subscriber sir! Kudos!
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
Жыл бұрын
Glad you liked it!
@lemoi6462
10 ай бұрын
@@MarcoCodes Im glad that your glad that he liked it
@yadivergulyanitskyy7929
9 ай бұрын
@@lemoi6462 oh guys, and I'm so glad that you all are glad he liked it!
@MarcoCodes
4 ай бұрын
I'm even glad-er than that!
@Roadrunner_KZSK
3 ай бұрын
same
This was super helpful, I've always put off learning about Maven and now it seems way less daunting
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
7 ай бұрын
Glad it helped. What was the step you struggled with?
Excellent and concise tutorial, thanks!
@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
Жыл бұрын
Thank you! :)
Thank you for the short and very useful explanation. It would be good to have continuation of Maven topic with more advanced stuff
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
Жыл бұрын
Thank you!
awesome tutorial!! learning springboot with angular. I had to rebuild dependencies after adding. Learned so much more here. TY. HSG
Brilliant tutorial, Thanks. Pls make more videos like this.
Wowww! That went smooooth. Really helpful video on maven.
Thanks for making this video! Very nice!!
Concepts are crystal clear😊
I am a big fan. You are awesome. You are helping so many people
@MarcoCodes
Жыл бұрын
Thank you, Joseph!
loving your channel! subscribed and already told a few dev buddies to subscribe. great content
Amazing tutorial!! Thanks!
Incredible tutorial, fast and clear. Maven is a Java Swiss knife if you master it.
Very valuable content. Thank you!
Marco great thanks indeed! It is amazing and really useful!
Please keep going, we need more and more content about testing and best practicies
@MarcoCodes
2 жыл бұрын
Just finished recording the next video - so....more is coming :)
@michelchaghoury9629
2 жыл бұрын
@@MarcoCodes gr8 very excited
Excellent class!
thanks for the video! you explained it really good
MARCO THE G COMING AT IT AGAIN !!!! THX !!!!!!!
Crystal 🔮 clear ❤️❤️❤️❤️ What a content.
Man, thank you for this!
Thanks a lot. Awesome explanation.
this was excellent. thank you!
Awesome tutorial!!!❤
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
Жыл бұрын
Glad it helped!
Thank you, thank you very very very much, You do best, Keep Going MAN
Very well explained. Thank you Macro :)
awesome intro thanks!
Thank you for the wonderful tutorial
love your work
Thanks Marco!
Good video about Maven build tool. 👍
Great explanation
Thank you You are the best Keep going
I'm currently doing a task related with maven. This tutorial seems so promisiing. I'll update here how my task goes.
Thanks for the Video!
Very nice, thanks 👍🏻
Thank you Marco! =)
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
amazing, thank you so much
Thank you! 🙌
Thank you very much!
great content, thnx.
That was cool!
the best tutorial , tnx
Great nice work
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.
love it
Cool Bro !!!
Thank you
Thanx man!))
thank you
Thank you very much! Make same overview for Gradle, please!
Marco can you please make a video explaining Maven Vs Gradle in a nice and easy manner?
the second time and i think there will be third One 👍
Nice tutorial. Could you please give the multi-module example project repository?
@MarcoCodes
8 ай бұрын
I should be a different branch in the linked source repository.
thanks.
Tnx
This man is crazy just for use the light theme in his IDE
@MarcoCodes
9 ай бұрын
No matter which theme, people complain :)
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
Жыл бұрын
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
Жыл бұрын
@@MarcoCodes Thanks for you detailed explanation!
nice video ma dude, now what do you use and prefer? Maven or gradle? and why?
@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
Жыл бұрын
@@MarcoCodes thanksss
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
Жыл бұрын
Only call "install", not "install:install" :)
Marco please make video on maven plugins..thanks for valuable content though
@MarcoCodes
Жыл бұрын
any specific questions about Maven plugins?
really enjoyed this and jdbc vid.... can you cover tomcat in depth for us ???
@MarcoCodes
Жыл бұрын
Not on the list at the moment, but I'll put it in the backlog.
Hi Marco, Any reason you skipped the "verify" step?
@MarcoCodes
Жыл бұрын
Hey Omri, no specific reason, other than I somewhat have seen it more rarely used in projects in the past.
@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.
I cannot find the code of the tutorial in github
@MarcoCodes
5 ай бұрын
Check the references doc from the description.
how I build a simple module app with img resources?
@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
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
Massive ads you did, hope it’s nice as first ! Good video
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
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
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.
24:14 There is version specified there
@MarcoCodes
10 ай бұрын
Hm?
@okey1317
10 ай бұрын
@@MarcoCodes I see there. You told it isn't
@MarcoCodes
10 ай бұрын
That's the parent's version, not the version of the module.
0:00 - 0:02 🤣
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
4 ай бұрын
What? :)
@guai9632
4 ай бұрын
@@MarcoCodes you wrote bs on the thumbnail
@MarcoCodes
4 ай бұрын
whaaaaaaaaat
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
11 ай бұрын
Gildware! Gildware!
Sauce Code .-.
try to use darkmode please
@MarcoCodes
Жыл бұрын
Not going to happen, as people complained about dark mode when I used it :D
I hate learning about new build systems just to install a single package