michaelboyles / maven-template

An opinionated Maven project template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An opinionated template for a Maven project that I feel is a good starting point for a new project. Obviously, additional tweaking will probably be necessary. Notably, I've omitted any major framework such as Spring because there are several valid alternatives (Quarkus, Micronaut, or no framework at all).

Includes:

  • PMD for static analysis, and an opinionated configuration of its Java rules
  • Checkstyle for consistent code style, configured to use Google's style guide
    • In practice, I think Google's rules can be improved upon, so I use a slightly customized rule set
  • Jacoco for code coverage
  • Flatten plugin for cleaning up POMs
  • Enforcer plugin to prevent mistakes in POMs

Dependencies included by default:

  • Lombok to reduce boilerplate
  • Junit for unit tests
  • Slf4j as a logging facade. If you're writing an application, you will need a logging implementation (Logback, Log4j, etc.)

Now what?

If you're writing an application (as opposed to a library), you will probably want to choose some way to bundle your application together with its dependencies, either as a fat JAR (e.g. Spring Boot Maven Plugin, the Maven Shade plugin, or the Maven Assembly plugin), or as a Docker image (e.g. with Spring Boot).

About

An opinionated Maven project template

License:The Unlicense


Languages

Language:Java 100.0%