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

vaadin-maven-plugin failed to build-frontend after updating java level to 17 #13545

Closed
kyberorg opened this issue Apr 14, 2022 · 4 comments
Closed

Comments

@kyberorg
Copy link

kyberorg commented Apr 14, 2022

Description of the bug

After updating language version to Java 17 vaadin-maven-plugin fails to compile frontend due to reflection error.

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:23.0.5:build-frontend (default) on project yalsee: Could not execute build-frontend goal: Error occured during goal execution: Cannot invoke "java.lang.Class.isInterface()" because the return value of "org.reflections.Reflections.forClass(String, java.lang.ClassLoader[])" is null

Full stacktrace is here

Expected behavior

Application compile into JAR-file without issues

Minimal reproducible example

  • git clone https://github.com/kyberorg/yalsee.git
  • cd yalsee
  • git checkout 827-java-17-code-adaption
  • mvn -Pproduction-mode,noTesting clean package

Versions

  • Vaadin / Flow version: 23.0.5
  • Java version: 17.0.3 OpenJDK
  • OS version: "linux", version: "5.16.14-1-manjaro", arch: "amd64", family: "unix"
  • Maven version: 3.8.1
  • Browser version (if applicable): N/A
  • Application Server (if applicable): N/A
  • IDE (if applicable): IDEA
@mcollovati
Copy link
Collaborator

mcollovati commented Apr 14, 2022

Seems like the problem is somehow related to lombok and --enable-preview flag.
The NPE is due to failure in loading class MyLinksPage

Preview features are not enabled for io/kyberorg/yalsee/ui/pages/mylinks/MyLinksPage (class file version 61.65535). Try running with '--enable-preview')

Adding the --enable-preview flag to the main process seems to solve the issue (eg export MAVEN_OPTS="$MAVEN_OPTS --enable-preview")

@kyberorg
Copy link
Author

@mcollovati I can confirm, that adding --enable-preview leads to successful compilation. Thanks/Kiitos.

OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from Needs triage to Closed Apr 14, 2022
@jcaSteelElec
Copy link

Hi everyone, I am new on the github forum and I don't know where I can post my question about this issu.
Where I can add in my project "--enable-preview" ? in the POM ? Thnk you in advance

@ZhukovAlV
Copy link

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

No branches or pull requests

4 participants