Is it possible to provide a custom main(String[] args)
method for a Quarkus application? Or is there any other way to access the command line arguments?
The use case would be to build a native image to be used as a command line tool.
This is now officially supported :) https://quarkus.io/guides/lifecycle
import io.quarkus.runtime.annotations.QuarkusMain;
import io.quarkus.runtime.Quarkus;
@QuarkusMain
public class Main {
public static void main(String ... args) {
System.out.println("Running main method");
Quarkus.run(args);
}
}
Currently Quarkus doesn't support this use case, however it is definitely on the roadmap, see: https://github.com/quarkusio/quarkus/issues/284
Update: see https://stackoverflow.com/a/61665893/2504224 for the supported way of doing this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With