Spring Boot base project with:
- Spring Web MVC
- Spring Security
- Spring Data JPA
- Liquibase
- PostgreSQL
- H2 in-memory database for tests
- OpenAPI UI (springdoc)
- Java 21+
- Maven 3.8+
- PostgreSQL running locally or reachable from this app
- Application entry point: src/main/java/com/hulous/base/BaseApplication.java
- Main config: src/main/resources/application.yaml
- Environment values: src/main/resources/env.properties
- Example environment values: .env.sample.properties
The app imports env values from src/main/resources/env.properties.
- Copy the sample file:
cp .env.sample.properties src/main/resources/env.properties- Update values in src/main/resources/env.properties.
Required keys:
- DB_NAME
- DB_HOST
- DB_PORT
- DB_USER
- DB_PASSWORD
- JWT_SECRET_TOKEN
- MAIN_APP_PORT
Notes:
- Use a strong random value for JWT_SECRET_TOKEN.
- MAIN_APP_PORT controls the HTTP port used by Spring Boot.
Start with Maven:
mvn spring-boot:runBuild a jar:
mvn clean packageRun tests:
mvn test- Unit and integration tests are configured to use an H2 in-memory database.
- The Maven
pom.xmlnow includescom.h2database:h2as a test dependency. - Test datasource settings are defined in
src/test/resources/application.yaml. - Liquibase runs during tests using
classpath:db/changelog/db.changelog-master.yaml.
Once the app is running, OpenAPI UI is available at:
Liquibase dependency is included. Add changelogs under:
- src/main/resources/db/changelog
This repository currently has mvnw/mvnw.cmd scripts but is missing wrapper metadata in .mvn/wrapper. Because of that, ./mvnw does not work at the moment.
Use system Maven commands (mvn ...) until wrapper files are restored.