Hello Spring Boot team,

Our application is on SpringBoot 3.0.2 + Spring Cloud 2022.0.1

In our pom, on the <build> <plugin> part, we only have, with nothing else

<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

During our pipeline, we generate a native image using mvn -Pnative native:compile We do get a native executable out of this step. It is working.

During SpringOne, during the talk "From Spring Native to SpringBoot 3" https://springone.io/sessions/from-spring-native-to-spring-boot-3 at minute 12, Sebastien mentioned the need of using the org.graalvm.buildtools native-maven-plugin (please see screenshot)

Screenshot_20230208_114127

We are able to build several native images without this dependency, just with the org.springframework.boot spring-boot-maven-plugin + mvn -Pnative native:compile alone.

We tried comparing the image built with, versus the one built without native-maven-plugin and could not see any difference.

Is it possible that indeed, a native image can be built without native-maven-plugin?

And since a native image can be built without, what are the difference between with and without?

I wanted to reach out with this bug report, it seems either there is a bug where without native-maven-plugin, a native image can still be built, or the message during SpringOne is maybe not accurate.

Before closing, just wanted to mention this presentation is very well made, thank you very much for native support in SpringBoot 3.

Comment From: mhalbritter

Hey,

what a flattering screenshot of my face - and btw, this is Sebastien, not Stephane :)

You're right that this is not needed when using native:compile. But if you try to use the buildpacks with ./mvnw -Pnative spring-boot:build-image, then the native-maven-plugin is needed. Otherwise the reachability metadata isn't downloaded and starting your apps looks like this:

╰─$ docker run --rm docker.io/library/graal-mvn:0.0.1-SNAPSHOT

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.2)

%PARSER_ERROR[d] %PARSER_ERROR[p] 1 --- [%PARSER_ERROR[t]] %PARSER_ERROR[logger] : %PARSER_ERROR[m]%PARSER_ERROR[n]%PARSER_ERROR[d] %PARSER_ERROR[p] 1 --- [%PARSER_ERROR[t]] %PARSER_ERROR[logger] : %PARSER_ERROR[m]%PARSER_ERROR[n]%PARSER_ERROR[d] %PARSER_ERROR[p] 1 --- [%PARSER_ERROR[t]] %PARSER_ERROR[logger] : %PARSER_ERROR[m]%PARSER_ERROR[n]% 

Comment From: patpatpat123

Very clear explanation, many thanks @mhalbritter