Skip to content

Conversation

@mcollovati
Copy link
Contributor

Adds support for native image build by registering classes for reflection and patching Atmosphere.

Fixes #157

Adds support for native image build by registering classes for reflection and
patching Atmosphere.

Fixes #157
@mcollovati
Copy link
Contributor Author

The Servlet 6 API patches can be removed if we update our Atmosphere fork to that version of the specification.

@mcollovati
Copy link
Contributor Author

@mcollovati
Copy link
Contributor Author

mcollovati commented Feb 7, 2025

It can be tested on the integration test modules or on the Quarkus starter by running mvn package -Pproduction -Dquarkus.package.type=native and then launching the native executable.

I tested it only on Linux. Needs to be tested on Windows and Mac.

The PR applies the same reflection hints present in the vaadin-spring artifact, but something may still be missing and discovered only by end-users.

@mshabarov mshabarov requested a review from caalador February 10, 2025 12:38
Comment on lines 210 to 211
.includePatterns(
"META-INF/maven/com.github.mcollovati/quarkus-hilla-commons/pom\\.properties")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this pom required?
If so could we have it as a com.vaadin package instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The path must be updated.
The point is to include it in the native image for methods like Platform.getVaadinVersion()
It can probably be removed, if the methods are used only in dev mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@sonarqubecloud
Copy link

Copy link
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could build a native image of the production it-test module in quarkus with windows, but did meet with oracle/graal issue 9727
and had to do the build as mvn package -Pproduction -Dquarkus.package.type=native -Dquarkus.native.additional-build-args=-J-Djdk.console=jdk.base

Copy link
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully with GraalVM CE 23.0.2+7.1 on mac with the production test module.

@mshabarov mshabarov merged commit 23e176d into main Feb 13, 2025
3 checks passed
@mshabarov mshabarov deleted the issues/157-native_image branch February 13, 2025 10:02
@Legioth Legioth added this to Roadmap Feb 28, 2025
@Legioth Legioth moved this to March 2025 (24.7) in Roadmap Feb 28, 2025
@vaadin-bot
Copy link

This ticket/PR has been released with Vaadin 24.7.0.rc2 and is also targeting the upcoming stable 24.7.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: March 2025 (24.7)

Development

Successfully merging this pull request may close these issues.

Atmosphere dependency makes native image build fail

4 participants