This is a template project for creating library projects more quickly. It does not include test fixtures or integration tests as these are not always required, but attempts to give the other commonly used components that I like to use on library projects including:
-
Lombok for boilerplate code generation
-
AssertJ for fluent and readable assertions
-
SLF4J for abstracted and pluggable logging
-
JUnit5 for unit testing
-
Mockito for mocking
-
Axion release plugin for version management
-
Spotless plugin for code formatting
-
Nebula plugin for gradle linting
-
Versions plugin for monitoring dependency versions
-
Jacoco plugin for code coverage reporting
-
Test Logger plugin for pretty printing of test results when running tests from gradle
-
Github actions for the build pipeline
-
Maven publish plugin for publishing snapshots and releases to Maven Central
-
Nexus staging plugin to automatically close and drop releases published to Maven Central
-
Better code hub for code and architecture analysis
-
Codecov for code coverage analysis
-
Sonar Cloud for static code analysis
-
Codacy for additional static code and coverage analysis
-
Dependency Check checks dependencies for vulnerabilities
For a number of the above tools to work your Github Actions pipeline will require the following secrets to be set up:
- SONAR_TOKEN for Sonar Cloud analysis
- CODACY_TOKEN for Codacy analysis
- OSSRH_USERNAME and OSSRH_PASSWORD for releasing snapshots and releases to Maven Central
- OSSRH_PGP_SECRET_KEY and OSSRH_PGP_SECRET_KEY_PASSWORD for signing release artifacts before pushing to maven central
// cleans build directories
// checks dependency versions
// checks for gradle issues
// formats code
// builds code
// runs tests
// checks dependencies for vulnerabilities
./gradlew clean dependencyUpdates lintGradle spotlessApply build