-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to easily generate a maven/gradle project that can be compiled to a native image #549
Comments
I am not sure this has a lot of interest. The build plugins are not a project generator, they simply provide a plugin for integrating with Gradle or Maven. I do agree that the Maven setup is not straightforward, but that's Maven's verbosity's fault, nothing much we can do. We have samples in the repository that you can also copy and paste. As for generating projects, as you mentioned 3rd party frameworks have such generators which are actually much more likely to be used. Micronaut has start.micronaut.io which would give you a project in a couple seconds, that you are more likely to tweak. There's also https://graal.cloud/gcn/launcher/ . Spring also provides a starter. For example, for my own demos, I simply end up writing:
And I'm done, I have exactly what you are asking for. I can then do I am wondering in which circumstances you would generate a project without such a framework, beyond a demo. I'd be tempted to say that this is unlikely, so the effort in implementing such a feature is arguable, given that you can already generate projects with these. The counter argument is "I don't want to explain a framework to show a native image demo", but I'm not convinced that this is enough. |
The only use cases I can think of are the following:
I agree that a minimal project one could |
Let's check our options.
Given that for CLI apps you are likely to implement CLI parsing, you will minimally use something like Picocli. With Micronaut you'd just change the
Right, this one may be useful to do without external frameworks. Copying one of the samples or cloning a demo repo might be good enough though.
Well, same here. Either cloning a repo or using commands like |
Is your feature request related to a problem? Please describe.
Often when trying to create a reproducer for a native image issue or show someone a Hello World example I end up copy pasting an older project and manually adjusting dependencies etc.
Looking at the "getting started" guides of native build tools there is an example but it feels kind of loaded. The application is not a simple "Hello World" but a fortune teller parsing a json file, the whole set-up requires the creation of a number of files by copy pasting code, etc.
Describe the solution you'd like
Ideally I would like a one/two liner(s) to get a simple project setup that can be compiled to native image.
For instance Quarkus offers the option to run
quarkus create app org.acme:minimal
and generates a project with the specified groupID and artifactID generating the maven pom files as well (it also supports generating gradle configs, and other options which are out of the scope of this issue).Describe alternatives you've considered
An alternative could be to mention in the "getting started" docs that one could glone https://github.com/graalvm/graalvm-demos/tree/master/java-hello-world-maven for a simple hello world, and have the fortune demo as a more advanced option.
cc @fniephaus
The text was updated successfully, but these errors were encountered: