# Maven Plugin Configuration Options ## Contents - Plugin goals - Configuration options - Build arguments - Common buildArg flags - Parent POM inheritance - Shaded JAR support - Full example ## Configuration options | Option | Type | Default | Purpose | |--------|------|---------|---------| | `` | String | artifactId | Name of the output executable | | `` | String | — | Entry point class (required) | | `` | boolean | `false` | Generate debug info | | `` | boolean | `false` | Enable verbose build output | | `` | boolean | `false` | Allow fallback to JVM | | `` | boolean | `false` | Build shared library instead of executable | | `` | boolean | `false` | Faster build, lower runtime performance | | `` | boolean | `true` | Use argument file for long classpaths | | `` | boolean | `false` | Skip native compilation | | `` | boolean | `false` | Skip native test execution | | `` | List | empty | Arguments passed directly to `native-image` | | `` | List | empty | JVM arguments for the native-image builder | | `` | List | empty | Arguments passed to the app at runtime | | `` | Map | empty | Environment variables during build | | `` | Map | empty | System properties during build | | `` | List | auto | Override classpath entries | | `` | String | auto | Override classes directory | ## Build arguments Pass any `native-image` flag via ``: ```xml --initialize-at-run-time=com.example.LazyClass -H:IncludeResources=.*\.xml$ -O2 ``` ### Common buildArg flags **If a class must not initialize at build time:** ```xml --initialize-at-run-time=<class-or-package> ``` **If a class must initialize at build time:** ```xml --initialize-at-build-time=<class-or-package> ``` **If the build runs out of memory:** ```xml -Xmx8g ``` **If you need to include resource files:** ```xml -H:IncludeResources=.*\.(properties|xml)$ ``` **If you want to inspect build details:** ```xml --diagnostics-mode ``` **If you want fastest build time (dev iteration):** ```xml -Ob ``` ## Parent POM inheritance Child projects can append build arguments to a parent POM config using `combine.children`: ```xml --verbose ``` ## Shaded JAR support If using `maven-shade-plugin`, point the native plugin to the shaded JAR: ```xml false ${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar ``` ## Full example ```xml org.graalvm.buildtools native-maven-plugin 0.11.1 true build-native compile-no-fork package myapp com.example.Main true --initialize-at-run-time=com.example.Lazy -H:IncludeResources=.*\.properties$ -O2 -Xmx8g ```