spring-bootmavenspring-native

Spring Native custom name for generated executables


I want to change the name of the generated executables in Spring Native with Maven. Default is the <artifactId> from the pom.xml.

If we want to specify the name of the resulting .jar file, we have an option to configure this with <finalName> inside the spring-boot-maven-plugin plugin configuration.

Is there a similar configuration property to allow the same behavior for the native-image-plugin?


Solution

  • I just found a solution using <imageName> inside the native-image-plugin configuration like:

    pom.xml (only part of file shown)

                        ...
                        <plugin>
                            <groupId>org.graalvm.buildtools</groupId>
                            <artifactId>native-maven-plugin</artifactId>
                            <configuration>
                                <imageName>app</imageName>
                            </configuration>
                        ...