Skip to content

Maven 模板项目,快速开始 Java 开发。包含了常用依赖库,如日志、测试和代码格式化等,并提供了一个开箱即用的 Maven 项目结构。(Maven template project for quick Java development startup. It includes commonly used dependencies such as logging, testing, code formatting, and provides a ready-to-use Maven project structure.)

License

Notifications You must be signed in to change notification settings

Sanjeever/maven-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Maven 模板项目,快速开始 Java 开发。包含了常用依赖库,如日志、测试和代码格式化等,并提供了一个开箱即用的 Maven 项目结构。(Maven template project for quick Java development startup. It includes commonly used dependencies such as logging, testing, code formatting, and provides a ready-to-use Maven project structure.)

Resources

License

Stars

Watchers

Forks

Packages

No packages published