quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.43k stars 2.58k forks source link

Migrating to Quarkus 3 for extensions requiring Java 17 #33805

Open zbendhiba opened 1 year ago

zbendhiba commented 1 year ago

Description

When migrating a Quarkus application from Quarkus 2.x to Quarkus 3.x using the quarkus update command, please note the following:

If the application is built using Java 11 and the Quarkus extensions now require a minimum of Java 17 (Camel extensions for example), it is necessary to migrate the project to Java 17. Failure to do so will result in the project not running, requiring the user to troubleshoot the issue.

Implementation ideas

No response

ia3andy commented 1 year ago

@gsmet is this possible with OpenRewrite? (update the Java version based on a dependency)

ia3andy commented 1 year ago

cc @maxandersen

gsmet commented 1 year ago

Well, it should be possible by writing a custom rule. I don't think I will have the time to work on this though.

maxandersen commented 1 year ago

Yeah, a custom rule seems simple enough @ia3andy ?

Just need the update tool to detect java 17 is needed for some of the updated extensions and then generate that as part of the generated script?

maxandersen commented 1 year ago

Quick search finds multiple recipes for handling java tooling updates. One is https://docs.openrewrite.org/recipes/java/migrate/javaversion20 - similar variations for java 8 and 17 Afaics.

gsmet commented 1 year ago

Updating the properties is easy but we need to detect the presence of the Camel extensions, that's why we need a custom rule.

Another option would be to hardcode it in the logic that generates the Quarkus version update recipes. But I don't think it's a good idea.