-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Generate projects for Java 11 by default #8151
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
OK, I tested all the project creation combinations, it was fun \o/. |
@patriot1burke should we also make this change for your Amazon Lambda archetypes? Or do you want to stick to 8 for now? |
You need to remove the |
By default, it is based on the Java version used to create the project. It can be overridden in CreateProject though if you really want to enforce it in your tools. I haven't exposed it for now as we will probably remove it or tweak it later. Note that even if you enforce it, it will still use either 8 or 11 for now. We might want to further enhance that later.
@gastaldi I don't want to do that. We want to support 8 still. But I think I pushed an appropriate work around. |
@@ -134,6 +147,15 @@ public boolean doCreateProject(final Map<String, Object> context) throws IOExcep | |||
} | |||
|
|||
public QuarkusCommandOutcome execute() throws QuarkusCommandException { | |||
// Define the Java version to use determined from the one specified or the one creating the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment isn't really helpful, just saying :)
Yes I'll do that now with my other work.
…On Wed, Mar 25, 2020 at 12:47 PM Georgios Andrianakis < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
independent-projects/tools/common/src/main/java/io/quarkus/cli/commands/CreateProject.java
<#8151 (comment)>:
> @@ -134,6 +147,15 @@ public boolean doCreateProject(final Map<String, Object> context) throws IOExcep
}
public QuarkusCommandOutcome execute() throws QuarkusCommandException {
+ // Define the Java version to use determined from the one specified or the one creating the project
The comment isn't really helpful, just saying :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8151 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL53YM5W5ZHN546V3OKULRJIYR3ANCNFSM4LTPTECA>
.
--
Bill Burke
Red Hat
|
Matcher matcher = JAVA_VERSION_PATTERN | ||
.matcher(this.javaTarget != null ? this.javaTarget : System.getProperty("java.version", "")); | ||
if (matcher.matches() && Integer.parseInt(matcher.group(1)) < 11) { | ||
invocation.setProperty(JAVA_TARGET, invocation.getBuildTool() == BuildTool.MAVEN ? "1.8" : "1_8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not have one "java_target" and another "java_underscore_target" so the same property isn't to be treated differently ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the other option I pondered. I decided to go with this one.
@@ -107,7 +107,7 @@ | |||
</executions> | |||
<configuration> | |||
<javaParameters>true</javaParameters> | |||
<jvmTarget>1.8</jvmTarget> | |||
<jvmTarget>${java_target}</jvmTarget> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if grok this right this change is a change in the "api" of the code generation that means the templates now require java_target to be set which will not be the case if you are using 1.3.0 plugin (@aloubyansky correct me if i'm wrong on this here).
So 1.3.0 plugin will pick up latest 1.3.x platform and when generation happens it will fail.
To remedy this the various .ftl files should check if java_target is set.
if my freemarker syntax memory is right its something like ${java_target!"11"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if grok this right this change is a change in the "api" of the code generation that means the templates now require java_target to be set which will not be the case if you are using 1.3.0 plugin (@aloubyansky correct me if i'm wrong on this here).
That is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we should choose 1.8 as the default to have a consistent behavior. I'll go do that and test.
I approve despite I feel dirty doing so :) |
@maxandersen yeah... and you're not the one who had to write this :). |
@gastaldi I created the PR early so that you can have a look too.
I will try generating projects now :).