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.
- 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 🌐
Ensure that you have the following software installed:
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
Build the Docker image:
docker build -t maven-template .
Run the Docker container:
docker run --name maven-template -p 8080:8080 -d maven-template
Use the Spotless plugin to ensure consistent code style.
mvn spotless:check
mvn spotless:apply