I'm trying to serve static content from my applications classpath using embedded jetty and I have written the following code
Server server = new Server(80);
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirectoriesListed(true);
resourceHandler.setBaseResource(Resource.newClassPathResource("/"));
server.setHandler(resourceHandler);
server.start();
server.join();
If I run this code from my IDE (Intellij) everything works as expected, I get a directory listing of my classpath and can put html-files in my resource-directory
However, if I compile an executable jar-file using maven and maven-assembly-plugin to make a "jar-with-dependencies" and starting it with java -jar I'm met with the default jetty 404-page
So basically I'm trying to get the serving of static content to work and I'm really puzzled why this behaves differently when running to from the IDE vs command-line