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