Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 1.78 KB

README.md

File metadata and controls

79 lines (52 loc) · 1.78 KB

Maven Template Project

Welcome to the Maven Template project! 🚀

This is a simple Maven template project designed to help you quickly get started with Java development. It includes commonly used dependencies such as logging, testing, and code formatting tools, and provides an out-of-the-box Maven project structure.

README.md

Features

  • Supports JDK 8 ☕️
  • Pre-configured common dependencies:
    • Hutool: A popular Java utility library 🌟
    • SLF4J and Logback: For logging 📝
    • Lombok: To reduce boilerplate code in Java ✂️
    • JUnit 5: Unit testing framework ⚙️
    • Spotless: Ensures code style consistency 💅
  • Fast dependency retrieval using mirror repositories 🌐

Quick Start

Prerequisites

Ensure that you have the following software installed:

Build the Project

mvn package

After running this command, two JAR files will be generated in the target directory: one is a JAR without dependencies, and the other is a JAR with dependencies, e.g.,

  • maven-template-1.0.3.jar
  • maven-template-1.0.3-jar-with-dependencies.jar

To run the built JAR file, use:

java -jar ./target/maven-template-1.0.3-jar-with-dependencies.jar

Docker Usage

Build the Docker image:

docker build -t maven-template .

Run the Docker container:

docker run --name maven-template -p 8080:8080 -d maven-template

Code Formatting

Use the Spotless plugin to ensure consistent code style.

Check Code Format

mvn spotless:check

Apply Code Format

mvn spotless:apply

LICENSE

MIT