question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jetty plugin not serving resources

See original GitHub issue

The Jetty plugin when executing mvn jetty:run by default only serves src/main/webapp (also it seems ${project.output.directory}/webapp-tmp) as static resources.

The app theme files are copied only ${project.build.outputDirectory}/META-INF/resources which is served as per the Servlet 3.0 specification.

A fix for running jetty should be found other than requiring adding the plugin configuration

<webApp>
  <resourceBases> 
    <resourceBase>${project.build.outputDirectory}/META-INF/resources</resourceBase>
  </resourceBases>
</webApp>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
caaladorcommented, Nov 18, 2020

I guess the best way to go is to have the static files go to VAADIN/static and serve them from there by ourselves as then we do not need to care about jar vs war.

0reactions
plekucommented, Dec 7, 2020

Reopened to figure out how we can get any resources from the theme folder to work with using an url with path "/theme/my-theme/something.png" from Java or CSS regardless of the app packaging or used server. Currently it is possible to use relative paths in css and this part is handled by webpack and will work even after this copying.

Lets use #9535 for the implementation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to public static content with jetty-maven-plugin?
So, the question is: How I can expose static content with Jetty? It is not necessary to tell me how to do it...
Read more >
Jetty10 Programming Guide | The Eclipse Foundation
This section will look at Jetty's HttpClient non-blocking, asynchronous APIs that are perfectly suited for large content downloads, for parallel ...
Read more >
Deploying Web Applications in Jetty - Baeldung
Open the Run menu and click the Edit Configurations options. In the panel on the left search for Jetty Server, if it is...
Read more >
Configuring the Jetty Maven Plugin - xy2401.github.io
The classpath of the running Jetty instance and its deployed webapp are managed by Maven, and may not be exactly what you expect....
Read more >
Serving static resources in Javalin running as servlets
Javalin-standalone, which is used for deployment to application servers, does not support serving static files as this is a jetty feature and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found