Closed romil-patel-integrella closed 7 months ago
Hi @romil-patel-integrella - I see that the pom snippet above uses org.graalvm.buildtools.native-maven-plugin
, and think the documentation/error messages in this Jib extension may be a bit dated here and have caused confusion.
This extension was initially written to work with an older version of this plugin (old coordinates: org.graalvm.nativeimage.native-image-maven-plugin
) that had the native-image:native-image
goal, but reading the documentation for the new native-image-plugin, I see that the goal names and commands for building the native-image executable have changed. Looks like with the newer plugin, this is now done through mvn -Pnative -DskipTests package
or mvn native:compile
.
Could you try building the native-image executable with these commands and see if this is working first, before adding the Jib goal (... jib:build -Dimage=$REPO:$TAG …
) to containerize? Hopefully this can help narrow down the issue as well. Thanks!
Hi @emmileaf, Thanks for sharing the details
I am successfully able to run the below commands. However, If I do run the mvn clean -Pnative -DskipTests package
It does not invoke the GraalVM steps that I can see with the mvn -Pnative native:compile
mvn clean -Pnative -DskipTests package
mvn -Pnative native:compile
Also I am able to build the image using if I remove the dependencies and configurations from the jib plugin. Does below command create the native containerized image?
mvn -Pnative native:compile jib:build -Dimage=$REPO:$TAG -Djib.container.environment=SPRING_PROFILES_ACTIVE=prod
However, if I add the native as -Djib.container.environment=SPRING_PROFILES_ACTIVE=prod,native fails
However, if I add the native as -Djib.container.environment=SPRING_PROFILES_ACTIVE=prod,native fails
@romil-patel-integrella Could you help share the error message you are now seeing with mvn -Pnative native:compile
and the Jib parameters? (Assuming it's different that the original one reported in the issue)
Closing issue due to lack of OP response. Please reopen if this is still an issue.
I have a Spring Boot project with v3.1.0 and Java 17 which works fine. I am adding the GraalVM and trying to create the native containerized image. To create the same I am running the below command which results in No plugin found for prefix 'native-image' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories
Command:
mvn native-image:native-image -Dimage=$REPO:$TAG -Djib.container.environment=SPRING_PROFILES_ACTIVE=prod
pom.xml