-
Notifications
You must be signed in to change notification settings - Fork 4
Home
This project is an opinionated framework that extends Spring Boot to empower developers to implement APIs with CRUD and/or search support with ease.
When using these libraries for your own components (Controller, Service, Mapper, Repository), you can also use the testing libraries we ship to further reduce the amount of code you need to write.
Many Spring Boot RESTful APIs contain the same design patterns across microservices, their respective domains. These libraries are meant to reduce boilerplate code that are necessary to support CRUD and search operations. This project also has plans to
A similar approach is taken for the integration tests included in this project. Many developers write tests ad-hoc for the business logic that they require, however, when looking at the design patterns at high level, this logic can also be abstracted. Therefore, we are also shipping an integration testing framework to easily provide coverage for the libraries contained in this project.
This project also provides support to automatically generate code for Spring Boot components using only entity models, thereby reducing the amount of code a developer needs to write even further.
This project strives to ensure all dependencies use the most current up-to-date LTS versions.
| Name | Version | Documentation | Instructions |
|---|---|---|---|
| Docker Desktop | 4.25.2 (129061) | https://docs.docker.com | This project uses Liquibase to track the database changelogs used in the examples submodules, while populating test data for automated and manual testing. As such, please ensure Docker is running in the background by opening Docker Desktop. You may notice Liquibase fails at start up, otherwise. |
| Java | See here | https://docs.oracle.com/en/java/javase/21/ | Ensure Java with the specified version is sourced by configuring your preferred IDE and/or manually in your computer settings. |
JetBrains IntelliJ
Please follow the documentation for Configuring an annotation profile in IntelliJ, ensuring that theEnable annotation processing setting is enabled.
Eclipse
Please follow the documentation for Eclipse JDT-APT Project here.VSCode
Please follow the documentation for Annotation processing support in Gradle for VSCode.The root directory has a file called secrets-TEMPLATE.gradle that stores they key-value that Gradle will use to source private dependencies and running CI/CD processes like Sonar Cloud scanning.
To populate these secrets:
-
Duplicate the
secrets-TEMPLATE.gradlefile and rename it tosecrets.gradle. (Thesecrets.gradlefile is included in.gitignore.) -
Replace all respective values. You may reference secret configuration for the respective services below.
Github
Complete the steps for "Creating a personal access token (classic)", ensuring that it has read packages permission selected.
| Key | Example Value | Description |
|---|---|---|
| GPR_USER | "Jane Doe" |
Github Username |
| GPR_KEY | "ghp_xXxxxXXXxXxxxxXxXXXXxxxxXxXxXXXxXxXX" |
Github Access Token |
Sonar
Forking this project will not fork other CI/CD processes that use third-party tools & services, like Sonar Cloud. Contributors are free to use whichever tooling they'd like in their forked repository. As such, explaining steps to replicate the GitHub Actions in this repository to work in your own forked repository is out-of-scope for this document. If you would like to use Sonar Cloud locally, however, please reference the Sonar Cloud setup documentation here and populate the secrets below in your secrets.gradle file.
| Key | Example Value | Description |
|---|---|---|
| SONAR_ORGANIZATION | "MyOrganization" |
Your GitHub organization or username. |
| SONAR_PROJECT_KEY | "MyOrganization_springharvest" |
Your organization's Sonar Cloud project name. |
| SONAR_TOKEN | "ghp_xXxxxXXXxXxxxxXxXXXXxxxxXxXxXXXxXxXX" |
Your secure Sonar Cloud token that is associated with your personal or organization configured Sonar project. |
After completing the steps above, contributors should continue their setup by review the Contributor Guide.
After completing the steps above, users should continue their setup by following the proceeding instructions:
Ingest the desired Spring Harvest libraries into your preferred build tool. The available libraries / dependencies can be found in this project's packages repository.
Maven
<dependency>
<groupId>dev.springharvest</groupId>
<artifactId>{library-name}</artifactId>
<version>${version}</version>
</dependency>Gradle
compileOnly "dev.springharvest:{library-name}:${version}"
implementation "dev.springharvest:{library-name}:${version}"
testImplementation "dev.springharvest:{library-name}:${version}"
annotationProcessor "dev.springharvest:{library-name}:${version}"
testAnnotationProcessor "dev.springharvest:{library-name}:${version}"
compileOnly files("$buildDir/generated/sources/annotationProcessor/java/main")
annotationProcessor files("$buildDir/generated/sources/annotationProcessor/java/main")Users are provided examples that illustrate how to use the libraries in this project in their own.
Ensure Docker is running in the background.
From the root directory of this repository, run the following CLI comment, where {APP} is replaced by the example you are attempting to run.
./gradlew :projects:examples:{APP} clean build -x testEnsure Docker is running in the background.
From the root directory of this repository, run the following CLI comment, where {APP} is replaced by the example you are attempting to run.
./gradlew :projects:examples:{APP} bootRun -Pspring.profiles.active=postgres,liquibaseEnsure Docker is running in the background.
From the root directory of this repository, run the following CLI comment, where {APP} is replaced by the example you are attempting to run.
./gradlew :projects:examples:{APP} test