Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 951 Bytes

File metadata and controls

67 lines (45 loc) · 951 Bytes

Using OpenAPI 3 with GraalVM Native Image

Pre-requisites

  • GraalVM 22.2.0 / JDK 11
  • Swagger UI

Building Executable JAR

To create an executable jar, execute:

 mvn clean package

or

./gradlew clean build

Running the JAR application

java -jar target/springdoc-openapi-demo-3.1.6-SNAPSHOT-spring-boot.jar

or

java -jar build/libs/springdoc-openapi-demo-3.1.6-SNAPSHOT.jar

Building native image with GraalVM

To create a native image, execute the following command

mvn package -Pnative

or

./gradlew nativeCompile

Running the native application

To run the demo, execute the following:

target/springdoc-openapi-demo

or

build/native/nativeCompile/springdoc-openapi-demo

Start the Swagger UI

docker run --rm -p 80:8080 swaggerapi/swagger-ui

Open the Swagger UI by browsing to http://localhost:8082/