Embedded Jetty problems with V14

I have the following startup code which attempts to forcefully add every .jar file in my application lib folder.

public static void main(String[] args) throws Exception {
        final var server = new Server(8080);

        // Specifies the order in which the configurations are scanned.
        Configuration.ClassList classlist = Configuration.ClassList.setServerDefault(server);
        classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
        classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");

        // Creation of a temporal directory.
        File tempDir = new File(System.getProperty("java.io.tmpdir"), "JettyTest");
        if (tempDir.exists()) {
            if (!tempDir.isDirectory()) {
                throw new RuntimeException("Not a directory: " + tempDir);
            }
        } else if (!tempDir.mkdirs()) {
            throw new RuntimeException("Could not make: " + tempDir);
        }

        WebAppContext context = new WebAppContext();
        context.setInitParameter("productionMode", "false");
        // Context path of the application.
        context.setContextPath("");
        // Exploded war or not.
        context.setExtractWAR(false);
        context.setTempDirectory(tempDir);

        // It pulls the respective config from the VaadinServlet.
        context.addServlet(GuiceVaadinServlet.class, "/*").setInitOrder(1);

        context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*");

        context.setParentLoaderPriority(true);
        server.setHandler(context);

        // This add jars to the jetty classpath in a certain syntax and the pattern makes sure to load all of them.
        final var classpathEntries = ClassPathHelper.getAllClassPathEntries();
        final var ideMode = classpathEntries.size() > 1;
        final var resourceList = new ArrayList<Resource>();
        final var jarFiles = new ArrayList<File>();

        if (ideMode) {
            System.out.println("Starting in IDE Mode");
            for (String entry : ClassPathHelper.getAllClassPathEntries()) {
                if (entry.endsWith(".jar")) {
                    final var file = new File(entry);
                    jarFiles.add(file);
                }
            }
        } else {
            final var baseInstallDir = System.getProperty("user.dir");
            System.out.println("Starting in Server WebJar Mode");
            final var libsDirectory = new File(baseInstallDir, "lib");
            System.out.println("Scanning for jars in " + libsDirectory.getPath());
            for (File file : Objects.requireNonNull(libsDirectory.listFiles())) {
                if (file.getPath().endsWith(".jar")) {
                    jarFiles.add(file);
                }
            }
            final var sferionJar = new File(baseInstallDir, "sferion.jar");
            jarFiles.add(sferionJar);
            System.out.println("Found " + jarFiles.size() + " jar files");
        }

        for (File jarFile : jarFiles) {
            resourceList.add(Resource.newResource("jar:" + jarFile.toURI().toURL() + "!/"));
        }

        if (ideMode) {
            // It adds the web application resources. Styles, client-side components, ...
            //TODO: make this property dynamic somehow?
            resourceList.add(Resource.newResource("/usr/local/code/sferion/planglobal/src/main/webapp"));
        }

        // The base resource is where jetty serves its static content from.
        context.setBaseResource(new ResourceCollection(resourceList.toArray(new Resource[0]
)));

        server.start();
        server.join();
    }

You will notice I have an if(ide). If found that intellij does not run my application as a .jar file but rather the .class file and explictly states my java classpath jar by jar. When I run the application as a .jar file with a lib folder ClassPathHelper.getAllClassPathEntries() returns my main jar file only (sferion.jar). I am attempting to find all .jar files in my lib folder and add them as resources as per the suggested code here…

https://vaadin.com/docs/v14/flow/production/tutorial-jetty.html

This is our first application on Vaadin flow and so far we have spent over 30 hours trying to get the basic setup working. Most of that was dealing with this issue of .cache.js files not being served from the webjars. Can anybody help? I am feeling rather stuck.

As you can see here

https://stackoverflow.com/questions/58334419/vaadin-14-app-not-loading-cache-js-files-causing-blank-page

I have been seeking help for awhile.

Here is a screenshot of what I see when I try to visit this site…

https://imgur.com/a/QTMY2Ki

Have you checked this project https://github.com/mvysny/vaadin14-embedded-jetty ?