This repository contains the source code for a modular Java project built with Apache Maven. It is designed to accompany two lessons from the DIBS course, which walk you through the process of creating and scaling a Maven-based Java project.
✍️ While both lessons are written in Spanish, the code in this repository is fully in English to ensure accessibility for a broader audience.
-
✅ Creating a Basic Maven Project
Learn how to generate a simple Maven project using thequickstartarchetype, define its metadata (groupId,artifactId, etc.), understand the default folder structure, and run your first Java app. -
🏗️ Modular Architecture with Maven and Java
Take your project to the next level by transforming it into a multi-module setup with reusable components. You'll learn to separate responsibilities using alibmodule and anappmodule, structure your POM files accordingly, and compile and run modular apps from the command line.
This is a multi-module Maven project with two main modules:
lib: A library module that contains a simple utility method.app: The main application that consumes the utility fromlib.
echo-app-maven/
├── pom.xml # Root POM (parent)
├── lib/
│ ├── pom.xml # Library module
│ └── src/main/java/com/github/username/echo/EchoUtils.java
├── app/
│ ├── pom.xml # Application module
│ └── src/main/java/com/github/username/App.java
- Java 8 or higher
- Apache Maven 3.6 or later
Linux/macOS
mvn clean install && \
mvn -pl app exec:java \
-Dexec.mainClass=com.github.username.App \
-Dexec.args="Ryugamine Celty Shizuo"Windows (PowerShell)
mvn clean install && `
mvn -pl app 'exec:java' `
'-Dexec.mainClass=com.github.username.App' `
'-Dexec.args=Ryugamine Celty Shizuo'After a successful build, the output should include a lot of Maven logs followed by:
Ryugamine
Celty
Shizuo
This repository demonstrates:
- Generating a basic Maven project using an archetype.
- Understanding project metadata:
groupId,artifactId,version, andpackage. - Creating a multi-module architecture with shared configuration.
- Reusing logic across modules using Maven dependencies.
- Running Java programs via
exec-maven-plugin.
This project is licensed under the BSD-2-Clause License. Feel free to use, modify, and distribute it as per the terms of the license.