I went through Jetty documentation, unfortunately I failed to find a documentation on how to hook into Jetty classpath scanner and modify it to use a Jandex index instead. Therefore I'm asking for help for the Jetty community.
I am the author of Vaadin Boot and I'm looking for ways to speed up Jetty bootup. I am aware of Jetty Quickstart however it's definitely not easy to produce quickstart-web.xml
from Gradle. Therefore, I thought that I could build the Jandex Index of the app, then hook into Jetty classpath scanner to use that prebuilt Jandex Index.
I went through Jetty sources, however unfortunately I failed to find the way to reconfigure/replace the classpath scanner. Would you please have a couple of pointers for me on where to start, which class to override and how to register my custom classpath scanner to WebAppContext
? Thanks a ton!
If you want to speed up startup, using Jandex is a not an easy solution. (you'll be chasing all of your third party jars that do scanning, and jakarta jars too that do scanning, and you'll have to subvert the entire Servlet configuration layer to even get started effectively, and then you'll need to add the servlet classloader isolation logic on top of Jandex too)
Use quickstart, but use it in embedded mode with a custom
main(String[] args)
Example:
This
main()
takes a war + context-xml, and generates theWEB-INF/quickstart-web.xml
.