3

My goal

I only want to run my Micronaut app in the JVM -- I have no interest in native image support. However, I can't find any documentation about how to turn it off.

Why bother?

First, the native image support generates noise in my build output, like this:

> Configure project :service
[native-image-plugin] Instrumenting task with the native-image-agent: run
[native-image-plugin] Instrumenting task with the native-image-agent: runShadow
[native-image-plugin] Instrumenting task with the native-image-agent: test
[native-image-plugin] Instrumenting task with the native-image-agent: testNativeImage

Second, when I try to run a test in IntelliJ, it gives me this little menu, which means it takes one extra click to run the tests, which is annoying.

testNativeImage menu screenshot

My ask

Is there some way to remove or disable native image support in Micronaut? Or is there some compelling reason why this is not possible or desirable?

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47
Ian Phillips
  • 2,027
  • 1
  • 19
  • 31

1 Answers1

2

Have

plugins {
    id("com.github.johnrengelman.shadow") version "7.1.2"
    id("io.micronaut.minimal.application") version "3.5.1"
}

int your build.gradle (instead of io.micronaut.application). See also https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_individual_plugins

Martin Paljak
  • 4,119
  • 18
  • 20