flow: Cannot build Vaadin Flow with Java 17 - PermittedSubclasses requires ASM9

When trying to create a production build of our Vaadin application we encounter the following error:

Failed to execute goal com.vaadin:vaadin-maven-plugin:14.7.2:build-frontend (default) on project myvaadin: Execution default of goal com.vaadin:vaadin-maven-plugin:14.7.2:build-frontend failed: PermittedSubclasses requires ASM9

Environment:

  • Amazon corretto JDK 17
  • Maven 3.8.2
  • Debian 11

Looks similar to https://github.com/vaadin/flow/blob/master/flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FrontendAnnotatedClassVisitor.java. So bytebuddy/asm must by upgraded to use Opcodes.ASM9 instead of Opcodes.ASM8 (so needs asm version 9.1, see https://asm.ow2.io/versions.html)

Also see

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Got it.

Add this to your code to see the magic

public enum AnEnum {
    
    ONE() {
        @Override
        public String digit() {
            return "1";
        }
    };

    public abstract String digit();
}

Explanation can be found here: https://issues.apache.org/jira/browse/GROOVY-10194

Yes, that is also my conclusion, see first comment.