Maven Tutorial for Beginners: How to Install Maven on Mac and Windows
In this tutorial, ๐๐จ๐ฎ๐ฌ๐ก๐ข๐ค ๐๐ก๐๐ญ๐ญ๐๐ซ๐ฃ๐๐ (@Koushik_chat), Content Creator at LetCode, provides a step-by-step guide to set up Maven in your Java project. Whether you're on macOS or Windows, this video shows you how to install Maven, configure the JDK and Maven paths, and create your first Maven project using the terminal and IntelliJ IDE.
From setting up the environment to creating a working project, youโll gain a solid foundation in Maven project management.
๐ฏ Key Topics Covered:
โ Installing Maven on macOS and Windows
โ Configuring JDK and Maven paths for a proper setup
โ Creating your first Maven project using the terminal
โ Setting up a Maven project in IntelliJ IDEA
โ Understanding the Maven project structure and dependencies
โ Troubleshooting common setup and installation issues
00:00 Introduction & Maven Project Setup Overview
00:25 Installing Maven on macOS
01:10 Downloading & Setting Up JDK
02:40 Downloading & Setting Up Maven
03:14 Configuring Environment Variables for JDK & Maven
06:50 Creating a Maven Project via Terminal
09:17 Exploring the Maven Project Structure
11:23 Creating a Maven Project Using an IDE
12:35 Installing Maven on Windows
15:05 Recap & Key Takeaways
In this video, Koushik provides a comprehensive guide to setting up Apache Maven for Java projects on both Mac OS and Windows. The session begins with installing the Java Development Kit (JDK), recommending version 21 or above, and setting the JDK path for system recognition. On Mac OS, the preferred method involves using Homebrew or manually downloading the JDK, followed by configuring environment variables in the terminal (Zsh or Bash) for both Java and Maven paths.
The instructor explains downloading the Apache Maven binary zip (version 3.9.11), extracting it, and setting the M2_HOME and PATH variables so Maven commands can run globally. Verification of the installation is done using java -version and mvn -v.
Next, the video demonstrates creating a Maven project via the terminal using the mvn archetype:generate command, explaining the group ID (project namespace) and artifact ID (project name).
The process generates a default Maven project structure, including pom.xml, src/main/java, and src/test/java folders, with initial dependencies such as JUnit. The pom.xml is highlighted as the heart of the Maven project, defining project metadata, dependencies, and build configuration.
Koushik also shows how to create a Maven project using IntelliJ IDE, where the process is simplified through a graphical interface but results in the same project structure. For Windows, the setup is straightforward: install JDK, set JAVA_HOME and update the system PATH, then download Maven, configure environment variables, and verify using mvn -v.
The session concludes with a recap: learners now know how to install Maven, set up JDK and Maven paths, and create their first Maven project via terminal and IDE. The instructor hints at upcoming lessons on folder structure and Maven dependencies, laying the foundation for managing and building Java projects efficiently.
Koushik Chatterjee
Koushik is a seasoned Senior Software Analyst at TVS Next. In his role, Koushik collaborates with a dedicated team of software engineers and testers, leveraging his expertise to craft and deliver high-quality software solutions tailored for diverse clients. Specializing in testing tools and QA automation techniques, Koushik meticulously ensures the functionality, performance, and security of software products.