Skip to content
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

Add a parameter to select the java version for generated Quarkus projects (CLI and Maven) #21629

Closed
ia3andy opened this issue Nov 23, 2021 · 7 comments · Fixed by #22848
Closed
Assignees
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/maven good first issue Good for newcomers kind/enhancement New feature or request
Milestone

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Nov 23, 2021

Description

Continuing on #20849

The current implementation (👆) uses the shell java version to determine a compatible version (11 or 17 for now) in generated project.

We need to add this as a parameter (11 or 17, default still being automatic based on shell java version) in the CLI and Maven plugin.

Implementation ideas

See comment #21629 (comment)

@ia3andy ia3andy added the kind/enhancement New feature or request label Nov 23, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 23, 2021

/cc @ebullient, @maxandersen, @quarkusio/devtools

@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) area/maven labels Nov 23, 2021
@ia3andy ia3andy added the good first issue Good for newcomers label Nov 23, 2021
@ia3andy ia3andy changed the title Add the option to select the java version for generated Quarkus projects (CLI and Maven) Add a parameter to select the java version for generated Quarkus projects (CLI and Maven) Nov 23, 2021
@maxandersen
Copy link
Member

The current implementation (👆) uses the shell java version for the generated project.

where is that done ? That means if you run on on java 8,9,10,12,13,14,15, 16 or 17 what happens?

I think its a bad default to use the shell java version. It should be a fixed default (i.e. Java 11 until Java 17 is mainstream) to work reliably.

@ia3andy
Copy link
Contributor Author

ia3andy commented Nov 23, 2021

The current implementation (👆) uses the shell java version for the generated project.

where is that done ? That means if you run on on java 8,9,10,12,13,14,15, 16 or 17 what happens?

I think its a bad default to use the shell java version. It should be a fixed default (i.e. Java 11 until Java 17 is mainstream) to work reliably.

https://github.com/quarkusio/quarkus/pull/20849/files#diff-e3a379680d4a534804bfaf1f30197ae16808192379a05287be973b77585a8cc6

@abmushfiq
Copy link

i want to contribute to this issue please help me?

@ia3andy
Copy link
Contributor Author

ia3andy commented Nov 25, 2021

First question is the name?

  1. java-version / javaVersion
  2. java-target / javaTarget

(I do prefer 1.)

Maven Plugin:
https://github.com/quarkusio/quarkus/blob/main/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java

CLI CreateApp (need to decide with @ebullient where to add the parameter) :
https://github.com/quarkusio/quarkus/blob/main/devtools/cli/src/main/java/io/quarkus/cli/CreateApp.java

Method to set java target (if we decide to use javaVersion as name we should rename the method) already exists in the CreateProject Builder:
https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateProject.java#L101

@maxandersen
Copy link
Member

cli already has flags for --java, maybe have version as a optional value for it ? --java=11 ?

That does though cause a bit of mess since you can't then specify java version when using --kotlin as it currently excludes use of --java. I'm wondering if we shouldn't make target language be implicitly java so you don't need --java to set target language to java?

Then you can do quarkus create --java=11 --kotlin or quarkus create --java=17

So --java simply is used to set targeted java version?

@ebullient
Copy link
Member

I could drop java from the exclusive language group, and use it as a java version setting flag instead... unless we should be adding a --jvm option for setting the version (even when used with kotlin or scala)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/maven good first issue Good for newcomers kind/enhancement New feature or request
Projects
Status: Done
4 participants