From the course: Java Microservices with GraalVM

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Build a native Micronaut image

Build a native Micronaut image

- [Man] So we saw how to build a standard web service 2 using the Micronaut framework 3 and running it against GraalVM. 4 But the real power promise 5 in a containerized world from GraalVM 6 that unfortunately doesn't always manifest 7 is from running Java applications as native images. 8 So let's take a look at how to do that 9 with GraalVM and Micronaut. 10 The first thing we need to do 11 is navigate to our code directory and our terminal 12 and we're going to use the mn command once again, 13 to create an app, 14 and we're going to call it mnsvc-ntv, 15 we will tell it to build with Maven. 16 Now the new thing is we are going to specify 17 - features GraalVM. 18 This position is the artifact to be built 19 as a native artifact, 20 go ahead and hit Enter and run that. 21 Now that our artifact is created, 22 let's jump to our IDE and import this artifact. 23 Now that we have the native image imported, 24 let's open…

Contents