This Petclinic is a Micronaut application which I forked from Spring PetClinic and tried to migrate from Spring to Micronaut to know how Micronaut works. I respect Spring so much, and I think I should replace Spring logos with Micronaut logos to avoid confusion.
git clone https://github.com/bufferings/micronaut-petclinic.git
cd micronaut-petclinic
This Petclinic uses PostgreSQL. You could start PostgreSQL with docker:
docker-compose up db
./mvnw compile exec:exec
You can then access petclinic here: https://localhost:8080/
./mvnw package
java -jar target/*.jar
This PetClinic supports GraalVM native image build.
./mvnw package && docker build -t micronaut-petclinic .
I usually have ☕ (around 10 mins on my laptop) to wait for the build finishes.
Use Docker compose to start the application:
docker-compose up -d
It starts in 300-400ms.
From GraalVM 19.0.0, it fails to build native-image because of this issue: oracle/graal#1295
It works if I build GraalVM from master branch and use it. So for now, I prepared a Docker image with the build: https://hub.docker.com/r/bufferings/build-graalvm-docker
The Micronaut PetClinic sample application is released under version 2.0 of the Apache License.
- Basic features with Micronaut
- Native Image
- Logging
- Validation
- Error Handling
- Cache
- Hot Reloading?
- Tests
- Management