Skip to content

dimdnk/standard-maven-single-project-layout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

96 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ€” What is this template all about?

  • This template can be used as a base layer for a single-module Maven project.
  • Make the project easy to maintain with 7 issue templates.
  • Quick-start documentation with an extraordinary README structure.
  • Manage issues with 20 issue labels.
  • Make community healthier with all the guides like code of conduct, contributing, support, security...
  • Learn more with the official GitHub guide on creating repositories from a template.
  • To start using it, click Use this template to create your new repository.

πŸš€ Servicename Backend

πŸ“œ Description

A service created for implementing the servicename API...

πŸ› οΈ Technology stack

Java 21, Maven, Spring Boot

πŸ“’ Instructions

πŸ”Ί Local development

# Clone the repository
git clone https://github.com/dimdnk/standard-maven-single-project-layout.git my-service

# Navigate to project directory
cd my-service

# Install git hooks
pnpm install

# Start local dev services dependencies
docker compose -f compose.yaml up -d

#  Run the application in dev mode
mvn spring-boot:run -Dspring-boot.run.profiles=local -P dev

βš™οΈ Environment Variables

Variable Description Default
LOGGING_LEVEL_ROOT Set default logging level INFO

πŸ”Ί Tests

The application contains different test layers according to the Test Pyramid.

Unit tests are the base of the pyramid. They should make up the biggest part of an automated test suite.

To run JUnit tests, use:

mvn clean test

The next layer, integration tests, test all places where your application serializes or deserializes data. Application Service's REST API, Repositories, or calling third-party services are good examples.

Run this to enable integration tests, powered by testcontainers:

mvn clean verify -P use-testcontainers

The minimum percentage of code coverage required for the workflow to pass is 80%.


πŸ“† Changelog

Conventional changelog located here.

πŸ‘ Acknowledgments

...

πŸ™ Community & Contributions

Please follow Contributing page.

πŸ“™ Code of Conduct

Please follow Code of Conduct page.

πŸ’₯ Troubleshooting

...

πŸ“‘ License

This project is licensed under the Apache License. See the LICENSE file for more details.


GitHub Project Tooling Overview

πŸ”§ Build & Runtime

  • Java: OpenJDK 21 LTS
  • Maven: Build automation with Spring Boot parent POM
  • Spring Boot: Web framework with modulith architecture
  • Docker: Containerization with Docker Compose for local services

πŸ“¦ Package Management

  • pnpm: Node.js package manager (v22.15.0+ required)
  • Maven Wrapper: mvnw for consistent Maven execution

🎯 Code Quality & Formatting

  • Prettier: Code formatting with Java plugin support
  • Stylelint: CSS/SCSS linting
  • Checkstyle: Java code style enforcement
  • JaCoCo: Code coverage (90% minimum requirement)
  • ArchUnit: Architecture testing
  • Qulice: Optional comprehensive quality checks
  • Cursor Rules: Predefined code quality rules for Java development covering:
    • Maven best practices
    • Object-oriented design
    • Spring framework
    • Security guidelines
    • Performance optimization
    • Functional programming
    • Testing standards

πŸš€ Scripts (package.json)

  • lint: Run stylelint checks
  • prettier:check/write: Format validation/application
  • prepare: Install Husky git hooks
  • release: Automated releases with conventional changelog
  • node_modules:clear: Clean Node dependencies

βš™οΈ Git Workflow & Automation

  • Husky: Git hooks management
  • lint-staged: Pre-commit linting
  • Commitizen: Conventional commit messages
  • Commitlint: Commit message validation
  • Dependabot: Automated dependency updates

πŸ” GitHub Workflows

  • Build validation: Node.js project builds
  • Commit message checks: Conventional commit enforcement
  • PR title validation: Standardized pull request titles
  • Template setup: Repository initialization automation

πŸ§ͺ Testing Strategy

  • Unit Tests: JUnit-based (mvn clean test)
  • Integration Tests: Testcontainers support (mvn clean verify -P use-testcontainers)
  • Architecture Tests: Spring Modulith validation
  • Test Coverage: 90% minimum threshold

πŸ“‹ Project Templates & Documentation

  • 7 Issue Templates: Structured issue reporting
  • 20 Issue Labels: Comprehensive labeling system
  • Community Files: Contributing guidelines, Code of Conduct, Security policy
  • Conventional Changelog: Automated release notes

🌟 Development Profiles

  • default: Standard development
  • dev: With Spring Boot DevTools
  • production: Optimized for deployment
  • use-qulice: Enhanced quality checks
  • use-testcontainers: Integration testing

About

Standard Maven Single Module Project Layout

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •