The application needs a PostgreSQL database. The easiest way is to run aa PostgreSQL database via Docker with:
$ docker run -it --rm -p 5432:5432 -e POSTGRES_USER=dbuser -e POSTGRES_PASSWORD=theSecretPassword -e POSTGRES_DB=postgres postgres:11.5-alpine
Create a file under app/src/main/resources/application-dev.yml
with following content:
datasources:
default:
url: jdbc:postgresql://localhost:5432/postgres
driverClassName: org.postgresql.Driver
schema-generate: NONE
dialect: POSTGRES
username: dbuser
password: theSecretPassword
Run the application
./gradlew :app:run
./gradlew :app:build
. You can find the fat jar under app/build/libs/app-0.1-all.jar
./gradlew :app:optimizedJitJarAll
. You can find the fat jar under app/build/libs/app-0.1-all-optimized.jar
./gradlew :app:nativeCompile
. You can find the native image under app/build/native/nativeCompile/app
./gradlew :app:nativeOptimizedCompile
. You can find the native image under ./app/build/native/nativeOptimizedCompile/app
`
In one terminal, generate and run the native image or fat jar (see previous sections).
In another terminal, export the environment variable APP_URL
to the native image url and run the test-native
tests:
export APP_URL=http://localhost:8080
./gradlew test-native:test
- Micronaut HTTP Client documentation
- Micronaut Management documentation
- Micronaut Problem JSON documentation
- Micronaut OpenAPI Support documentation
- https://www.openapis.org
- Micronaut Hikari JDBC Connection Pool documentation
- Micronaut Data JDBC documentation
- KS-UID Java library
- Micronaut Thymeleaf Views documentation
- https://www.thymeleaf.org/