https://github.com/will-molloy/java-template
template repo for Java (or Kotlin/Scala) Gradle projects with everything setup
https://github.com/will-molloy/java-template
checkstyle codecov corretto github-actions github-actions-java gradle java java-template renovate spotbugs spotless template template-repository
Last synced: 8 days ago
JSON representation
template repo for Java (or Kotlin/Scala) Gradle projects with everything setup
- Host: GitHub
- URL: https://github.com/will-molloy/java-template
- Owner: will-molloy
- License: gpl-2.0
- Created: 2019-06-15T00:35:52.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2026-01-11T14:33:37.000Z (11 days ago)
- Last Synced: 2026-01-11T17:59:34.272Z (11 days ago)
- Topics: checkstyle, codecov, corretto, github-actions, github-actions-java, gradle, java, java-template, renovate, spotbugs, spotless, template, template-repository
- Language: Java
- Homepage: https://github.com/will-molloy/java-template/generate
- Size: 615 KB
- Stars: 6
- Watchers: 1
- Forks: 58
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-template
[](https://github.com/will-molloy/java-template/actions/workflows/build.yml)
[](https://codecov.io/gh/will-molloy/java-template)
template repo for Java (or Kotlin/Scala) Gradle projects
## Features
- JDK 25
- [Gradle 9](https://github.com/gradle/gradle) (Kotlin DSL)
- [GitHub Actions](https://github.com/features/actions) CI/CD
- Automatic code formatting via [Spotless](https://github.com/diffplug/spotless)
- Java: [`google-java-format`](https://github.com/google/google-java-format)
- Kotlin: [`ktfmt`](https://github.com/facebook/ktfmt)
- Scala: [`scalafmt`](https://github.com/scalameta/scalafmt)
- Code style analysis via [Checkstyle](https://github.com/checkstyle/checkstyle)
- Static analysis via [SpotBugs](https://spotbugs.github.io/)
- Unit and integration test support via [JUnit 5](https://junit.org/junit5/) and [TestSets plugin](https://github.com/unbroken-dome/gradle-testsets-plugin)
- Code coverage reporting via [Codecov](https://codecov.io/)
- Dependency upgrades via [Renovate bot](https://renovatebot.com)
## Usage
- Click [Use this template](https://github.com/will-molloy/java-template/generate)
- This will prompt you to create a new repo with all the files setup
- Rename the root project (currently `java-template`) and group (currently `com.willmolloy`) to your liking
- Delete anything you won't use
- Update the README
- Other non-code setup like GitHub branch protections
- _**NOTE:** if creating a private repo, you probably want to disable the windows and mac builds_
### Build and test
```bash
./gradlew spotlessApply build integrationTest
```
### Upgrade Gradle
_Renovate should cover this_
- Find the version number on the [releases page](https://gradle.org/releases/)
- [Java Compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html)
- Run: `./gradlew wrapper --gradle-version --distribution-type all`
### Upgrade Java
- Download the JDK using IntelliJ
- Update all references
## Promise
- Keep up to date with:
- Future Java versions
- Future Gradle versions
- Other dependency upgrades
- Any other cool tools or plugins
___
Generated from [java-template](https://github.com/will-molloy/java-template)