Quarkus error while creating native in container : quarkus Unknown lifecycle phase

Viewed 839

Following this guide : https://quarkus.io/guides/building-native-image

To this end, Quarkus provides a very convenient way of creating a native Linux executable by leveraging a container runtime such as Docker or podman. The easiest way of accomplishing this task is to execute: ./mvnw package -Pnative -Dquarkus.native.container-build=true

I get this error :[ERROR] Unknown lifecycle phase ".native.container-build=true". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-cl asses, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration -test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

Any other command i have used so far worked without problems.

2 Answers

Not sure you're still searching for a solution, but I had the same problem on version 2.2.2.final on Windows 10.

What worked for me : using --define instead of -d :

./mvnw package -Pnative --define quarkus.native.container-build=true

I think that you have missed the last part of the command, in the documentation you provided the actual command is:

./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true

  • quarkus.native.container-build=true allows for creating a Linux executable without GraalVM being installed (and is only necessary if you don’t have GraalVM installed locally or your local operating system is not Linux)

  • quarkus.container-image.build=true instructs Quarkus to create a container-image using the final application artifact (which is the native executable in this case)

https://quarkus.io/guides/building-native-image#creating-a-container

Related