You need to add the following bean configuration
@Bean UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() { UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(); factory.addBuilderCustomizers( builder -> builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); return factory; }
Then run the application using alpn-boot-8.1.9.v20160720.jar in the path to the boot class
java -Xbootclasspath/p:<<location>>/alpn-boot-8.1.9.v20160720.jar -jar <<your application>>
source share